From 58970e1c33b2630535de589b41874d46d0650c9c Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Fri, 8 Feb 2019 13:51:51 -0500 Subject: [PATCH] Use renamed 'hash_password' function, instead of 'password_hash' The original function was 'password_hash', but a function with the same name was added to core PHP, and rather than debugging integration with the new native function, this preserves the application's original function with less fuss. --- lib/PageRender.php | 2 +- lib/functions.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PageRender.php b/lib/PageRender.php index 7d86a54..5f9097b 100644 --- a/lib/PageRender.php +++ b/lib/PageRender.php @@ -287,7 +287,7 @@ class PageRender extends Visitor { break; default: - $vals[$i] = password_hash($passwordvalue,$enc); + $vals[$i] = hash_password($passwordvalue,$enc); } $vals = array_unique($vals); diff --git a/lib/functions.php b/lib/functions.php index 13ce4ca..e75277b 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -2388,7 +2388,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword # SHA crypted passwords case 'sha': - if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) + if (strcasecmp(hash_password($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) return true; else return false; @@ -2397,7 +2397,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword # MD5 crypted passwords case 'md5': - if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) + if( strcasecmp(hash_password($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) return true; else return false; @@ -2462,7 +2462,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword # SHA512 crypted passwords case 'sha512': - if (strcasecmp(password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) + if (strcasecmp(hash_password($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) return true; else return false;