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.
This commit is contained in:
Timothy Warren 2019-02-08 13:51:51 -05:00
parent c985215714
commit 58970e1c33
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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;