From eda9fbbb6363cad0f2035b7a1f9fafe27f23832b Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 25 Jun 2010 13:31:31 +0200 Subject: [ticket/9574] Remove conditional PHP<5.2 code There is a large amount of conditional code for PHP < 5.2 that can be removed with phpBB 3.1. PHPBB3-9574 --- phpBB/includes/functions.php | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b9c4bde1b7..48a9661347 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -394,7 +394,7 @@ function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6) } $output = '$H$'; - $output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)]; + $output .= $itoa64[min($iteration_count_log2 + 5, 30)]; $output .= _hash_encode64($input, 6, $itoa64); return $output; @@ -480,24 +480,12 @@ function _hash_crypt_private($password, $setting, &$itoa64) * consequently in lower iteration counts and hashes that are * quicker to crack (by non-PHP code). */ - if (PHP_VERSION >= 5) - { - $hash = md5($salt . $password, true); - do - { - $hash = md5($hash . $password, true); - } - while (--$count); - } - else + $hash = md5($salt . $password, true); + do { - $hash = pack('H*', md5($salt . $password)); - do - { - $hash = pack('H*', md5($hash . $password)); - } - while (--$count); + $hash = md5($hash . $password, true); } + while (--$count); $output = substr($setting, 0, 12); $output .= _hash_encode64($hash, 16, $itoa64); -- cgit v1.2.1