diff options
author | Andrey Andreev <narf@devilix.net> | 2017-01-19 14:26:35 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-01-19 14:26:35 +0100 |
commit | c0c74d5201c171cd6d0cdc2133e63077ebe1a407 (patch) | |
tree | 0dd88740ced31cfd122b207b3a00559edadcb79c /system/core/compat/password.php | |
parent | f565212c5aa07a8016394a3bc66874be83c73d4d (diff) |
More byte-safety
Diffstat (limited to 'system/core/compat/password.php')
-rw-r--r-- | system/core/compat/password.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/system/core/compat/password.php b/system/core/compat/password.php index b209cbe70..8176f0088 100644 --- a/system/core/compat/password.php +++ b/system/core/compat/password.php @@ -94,8 +94,8 @@ if ( ! function_exists('password_hash')) */ function password_hash($password, $algo, array $options = array()) { - static $func_override; - isset($func_override) OR $func_override = (extension_loaded('mbstring') && ini_get('mbstring.func_override')); + static $func_overload; + isset($func_overload) OR $func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload')); if ($algo !== 1) { @@ -109,7 +109,7 @@ if ( ! function_exists('password_hash')) return NULL; } - if (isset($options['salt']) && ($saltlen = ($func_override ? mb_strlen($options['salt'], '8bit') : strlen($options['salt']))) < 22) + if (isset($options['salt']) && ($saltlen = ($func_overload ? mb_strlen($options['salt'], '8bit') : strlen($options['salt']))) < 22) { trigger_error('password_hash(): Provided salt is too short: '.$saltlen.' expecting 22', E_USER_WARNING); return NULL; @@ -144,7 +144,7 @@ if ( ! function_exists('password_hash')) is_php('5.4') && stream_set_chunk_size($fp, 16); $options['salt'] = ''; - for ($read = 0; $read < 16; $read = ($func_override) ? mb_strlen($options['salt'], '8bit') : strlen($options['salt'])) + for ($read = 0; $read < 16; $read = ($func_overload) ? mb_strlen($options['salt'], '8bit') : strlen($options['salt'])) { if (($read = fread($fp, 16 - $read)) === FALSE) { |