Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/westberliner/checksum.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick <patrick@westberliner.net>2017-03-27 21:42:37 +0300
committerPatrick <patrick@westberliner.net>2017-03-27 21:42:37 +0300
commitec6207bae32371590bfafeae3b4fa9ba3efd5c26 (patch)
treedef2e4206e01aca9921d8c7a172a1d3bac703d06 /lib
parenteeae274621553d55e08221f86bd3d91930fe7b60 (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.php6
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() {