diff options
author | Patrick <patrick@westberliner.net> | 2017-03-27 21:42:37 +0300 |
---|---|---|
committer | Patrick <patrick@westberliner.net> | 2017-03-27 21:42:37 +0300 |
commit | ec6207bae32371590bfafeae3b4fa9ba3efd5c26 (patch) | |
tree | def2e4206e01aca9921d8c7a172a1d3bac703d06 /lib | |
parent | eeae274621553d55e08221f86bd3d91930fe7b60 (diff) |
- updated info.xmlv0.3.4
- added error handling if hash algorithm is not supported by server
- added reload button on ajax error response
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/ChecksumController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Controller/ChecksumController.php b/lib/Controller/ChecksumController.php index 8784c57..da31f59 100644 --- a/lib/Controller/ChecksumController.php +++ b/lib/Controller/ChecksumController.php @@ -27,12 +27,11 @@ class ChecksumController extends Controller { * @param (string) $type - hash algorithm type */ public function check($source, $type) { - if(!$this->checkAlgorithmType($type)) { return new JSONResponse( array( 'response' => 'error', - 'msg' => $this->language->t('This is not a valid algorithm type.') + 'msg' => $this->language->t('The algorithm type "%s" is not a valid or supported algorithm type.', array($type)) ) ); } @@ -65,7 +64,8 @@ class ChecksumController extends Controller { } protected function checkAlgorithmType($type) { - return in_array($type, $this->getAllowedAlgorithmTypes()); + $list_algos = hash_algos(); + return in_array($type, $this->getAllowedAlgorithmTypes()) && in_array($type, $list_algos); } protected function getAllowedAlgorithmTypes() { |