Changeset:
        1638a9495e94
        
https://sourceforge.net/p/mrbs/hg-code/ci/1638a9495e949e39cc9bada52413102bbbe2ea6b
Author:
        John Beranek <[email protected]>
Date:
        Sat Oct 17 23:17:54 2015 +0100
Log message:

Added check for existence of hash_hmac() function, in case the system's
PHP has the hash functionality disabled.

diffstat:

 web/session/session_cookie.inc |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (29 lines):

diff -r bf0ad75aa861 -r 1638a9495e94 web/session/session_cookie.inc
--- a/web/session/session_cookie.inc    Sat Oct 17 11:37:02 2015 +0100
+++ b/web/session/session_cookie.inc    Sat Oct 17 23:17:54 2015 +0100
@@ -93,6 +93,12 @@
       $session_data['ip'] = $REMOTE_ADDR;
     }
     $json_data = json_encode($session_data);
+    if (!function_exists('hash_hmac'))
+    {
+      fatal_error(FALSE, "It appears that your PHP has the hash functions ".
+                          "disabled, which are required for the 'cookie' ".
+                          "session scheme.");
+    }
     $hash = hash_hmac(
                       $auth["session_cookie"]["hash_algorithm"],
                       $json_data,
@@ -247,6 +253,12 @@
     
     $json_data = base64_decode($base64_data);
 
+    if (!function_exists('hash_hmac'))
+    {
+      fatal_error(FALSE, "It appears that your PHP has the hash functions ".
+                          "disabled, which are required for the 'cookie' ".
+                          "session scheme.");
+    }
     if (hash_hmac(
                   $auth["session_cookie"]["hash_algorithm"],
                   $json_data,

------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to