Skip to content

Commit 98b1d26

Browse files
Merge pull request #1 from topcoder-platform/issues-37
Added Validation Rule for API key
2 parents b5cd3b0 + f0e0f5b commit 98b1d26

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

class.filestack.plugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ public function settingsController_filestack_create($sender) {
162162
'Garden.Upload.MaxFileSize' => ['Control' => 'TextBox', 'Default' => c('Garden.Upload.MaxFileSize', ini_get('upload_max_filesize')), 'Description' => 'Allowed Max File Size. Accepted Measurements: Megabyte - M, Gigabyte - G.'],
163163
]);
164164

165+
if($cf->form()->authenticatedPostBack()) {
166+
$cf->form()->validateRule('Plugins.Filestack.ApiKey', 'ValidateRequired', t('You must provide Filestack API Key.'));
167+
}
168+
165169
$sender->setData('Title', sprintf(t('%s Settings'), 'Filestack'));
166170
$cf->renderAll();
167171
}

0 commit comments

Comments
 (0)