summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Burschka2016-04-04 18:36:06 +0000
committerChristoph Burschka2016-04-04 18:36:06 +0000
commit5e6ff31f201c36b6191f82c82a112f2b06d536d8 (patch)
treea2f5ac196abe5e3ac273d5aa9d3fcac48c9c902d
parentAdd multi-domain support to htpasswd plugin. (diff)
downloadejabberd-auth-php-5e6ff31f201c36b6191f82c82a112f2b06d536d8.tar.gz
Check that hash_equals() exists.
The hash_equals function was added in PHP 5.6.0. In older versions, fall back to ===.
-rw-r--r--plugins/htpasswd/htpasswd.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/htpasswd/htpasswd.inc b/plugins/htpasswd/htpasswd.inc
index 32f57ad..132efcf 100644
--- a/plugins/htpasswd/htpasswd.inc
+++ b/plugins/htpasswd/htpasswd.inc
@@ -30,7 +30,7 @@ function htpasswd_check($clear, $hash, $config) {
$result = $clear;
}
- return hash_equals($result, $hash);
+ return function_exists('hash_equals') ? hash_equals($result, $hash) : $result === $hash;
}
/**