diff options
Diffstat (limited to 'lib/Controller/ChecksumController.php')
-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() { |