From 5e6ff31f201c36b6191f82c82a112f2b06d536d8 Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Mon, 4 Apr 2016 18:36:06 +0000 Subject: Check that hash_equals() exists. The hash_equals function was added in PHP 5.6.0. In older versions, fall back to ===. --- plugins/htpasswd/htpasswd.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } /** -- cgit v1.1