From fec5497873c5c1e7e7ec80c5d61807b53bdaa871 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 27 Mar 2012 20:09:01 +1300 Subject: [PATCH 1/2] MINOR Removed old array_fill_keys() replacement for PHP 5.1, which is no longer supported. --- core/Core.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/core/Core.php b/core/Core.php index 2c450b15e..04f8fdf1f 100644 --- a/core/Core.php +++ b/core/Core.php @@ -40,19 +40,6 @@ if(defined('E_DEPRECATED')) error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT)); else error_reporting(E_ALL); -/* - * This is for versions of PHP prior to version 5.2 - * Creating this here will allow both web requests and cron jobs to inherit it. - */ -if (!function_exists('array_fill_keys')) { - function array_fill_keys($keys,$value) { - //Sometimes we get passed an empty array, and if that's the case, you'll get an error message - if(sizeof($keys)==0) - return Array(); - else - return array_combine($keys,array_fill(0,count($keys),$value)); - } -} /** * Include _ss_environment.php files From b92e4e01a95b131cf255a05f33eb2330f03d7654 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 27 Mar 2012 20:09:36 +1300 Subject: [PATCH 2/2] MINOR Removed PHP 5.1 check for PasswordEncryptor, use hash() always as PHP 5.1 is no longer supported. --- security/PasswordEncryptor.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/security/PasswordEncryptor.php b/security/PasswordEncryptor.php index 813c0f015..2574d7876 100644 --- a/security/PasswordEncryptor.php +++ b/security/PasswordEncryptor.php @@ -139,13 +139,7 @@ class PasswordEncryptor_PHPHash extends PasswordEncryptor { } function encrypt($password, $salt = null, $member = null) { - if(function_exists('hash')) { - // Available in PHP 5.1+ only - return hash($this->algorithm, $password . $salt); - } else { - // Fallback to global built-in methods - return call_user_func($this->algorithm, $password . $salt); - } + return hash($this->algorithm, $password . $salt); } }