diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 3058d3a3c..1c1a61dad 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1360,10 +1360,9 @@ class Context * @see Cast variables, such as _srl, page, and cpage, into interger * @param string $key Variable key * @param string $val Variable value - * @param string $do_stripslashes Whether to strip slashes * @return mixed filtered value. Type are string or array */ - public function _filterRequestVar($key, $val, $do_stripslashes = 1) + public function _filterRequestVar($key, $val) { if(!($isArray = is_array($val))) { @@ -1389,19 +1388,6 @@ class Context else { $result[$k] = $v; - - if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc()) - { - if (is_array($result[$k])) - { - array_walk_recursive($result[$k], function(&$val) { $val = stripslashes($val); }); - } - else - { - $result[$k] = stripslashes($result[$k]); - } - } - if(is_array($result[$k])) { array_walk_recursive($result[$k], function(&$val) { $val = trim($val); }); diff --git a/common/framework/password.php b/common/framework/password.php index caf9ef49a..a6831090b 100644 --- a/common/framework/password.php +++ b/common/framework/password.php @@ -79,11 +79,11 @@ class Password public static function getSupportedAlgorithms() { $retval = array(); - if (version_compare(PHP_VERSION, '5.3.7', '>=') && defined('\CRYPT_BLOWFISH')) + if (defined('\CRYPT_BLOWFISH')) { $retval['bcrypt'] = 'bcrypt'; } - if (function_exists('hash_hmac') && in_array('sha512', hash_algos())) + if (in_array('sha512', hash_algos())) { $retval['pbkdf2'] = 'pbkdf2'; } diff --git a/common/framework/security.php b/common/framework/security.php index 35abdda61..a474acb58 100644 --- a/common/framework/security.php +++ b/common/framework/security.php @@ -58,7 +58,7 @@ class Security $key = substr(hash('sha256', $key, true), 0, 16); // Use defuse/php-encryption if possible. - if (!$force_compat && version_compare(\PHP_VERSION, '5.4.0', '>=') && function_exists('openssl_encrypt')) + if (!$force_compat && function_exists('openssl_encrypt')) { try { @@ -96,7 +96,7 @@ class Security } // Use defuse/php-encryption if possible. - if (!$force_compat && version_compare(\PHP_VERSION, '5.4.0', '>=') && function_exists('openssl_decrypt')) + if (!$force_compat && function_exists('openssl_decrypt')) { try { @@ -147,11 +147,11 @@ class Security { $entropy = random_bytes($entropy_capped_bytes); } - elseif(function_exists('openssl_random_pseudo_bytes') && (!$is_windows || version_compare(\PHP_VERSION, '5.4', '>='))) + elseif(function_exists('openssl_random_pseudo_bytes')) { $entropy = openssl_random_pseudo_bytes($entropy_capped_bytes); } - elseif(function_exists('mcrypt_create_iv') && (!$is_windows || version_compare(\PHP_VERSION, '5.3.7', '>='))) + elseif(function_exists('mcrypt_create_iv') && !$is_windows) { $entropy = mcrypt_create_iv($entropy_capped_bytes, \MCRYPT_DEV_URANDOM); }