From 24ad2dd11ed66bafe3a8a9224b310d7e4b005446 Mon Sep 17 00:00:00 2001 From: tianhe1986 Date: Tue, 23 Aug 2016 17:44:21 +0800 Subject: Hash: processing algorithm name case-insensitively in hash_pbkdf2(): Signed-off-by: tianhe1986 --- system/core/compat/hash.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/core/compat/hash.php b/system/core/compat/hash.php index 6854e4c26..6d4a0c19a 100644 --- a/system/core/compat/hash.php +++ b/system/core/compat/hash.php @@ -119,6 +119,7 @@ if ( ! function_exists('hash_pbkdf2')) */ function hash_pbkdf2($algo, $password, $salt, $iterations, $length = 0, $raw_output = FALSE) { + $algo = strtolower($algo); if ( ! in_array($algo, hash_algos(), TRUE)) { trigger_error('hash_pbkdf2(): Unknown hashing algorithm: '.$algo, E_USER_WARNING); -- cgit v1.2.3-24-g4f1b From 1de09516123b4ca1caeef667d58261105d854ffe Mon Sep 17 00:00:00 2001 From: tianhe1986 Date: Tue, 23 Aug 2016 18:21:35 +0800 Subject: Move strtolower() inside the is_array() check, Signed-off-by: tianhe1986 --- system/core/compat/hash.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/core/compat/hash.php b/system/core/compat/hash.php index 6d4a0c19a..d567d0f80 100644 --- a/system/core/compat/hash.php +++ b/system/core/compat/hash.php @@ -119,8 +119,7 @@ if ( ! function_exists('hash_pbkdf2')) */ function hash_pbkdf2($algo, $password, $salt, $iterations, $length = 0, $raw_output = FALSE) { - $algo = strtolower($algo); - if ( ! in_array($algo, hash_algos(), TRUE)) + if ( ! in_array(strtolower($algo), hash_algos(), TRUE)) { trigger_error('hash_pbkdf2(): Unknown hashing algorithm: '.$algo, E_USER_WARNING); return FALSE; -- cgit v1.2.3-24-g4f1b