php deprecated 사용되는 코드 수정

This commit is contained in:
thisgun
2020-03-03 11:08:24 +09:00
parent 87bb2f1d8a
commit 799aefada2
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ function create_hash($password, $force_compat = false)
{
// Generate the salt.
if (function_exists('mcrypt_create_iv')) {
if (function_exists('mcrypt_create_iv') && version_compare( PHP_VERSION, '7.2' , '<' ) ) {
$salt = base64_encode(mcrypt_create_iv(PBKDF2_COMPAT_SALT_BYTES, MCRYPT_DEV_URANDOM));
} elseif (@file_exists('/dev/urandom') && $fp = @fopen('/dev/urandom', 'r')) {
$salt = base64_encode(fread($fp, PBKDF2_COMPAT_SALT_BYTES));