summaryrefslogtreecommitdiffstats
path: root/system/core/compat
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-12-14 15:14:13 +0100
committerAndrey Andreev <narf@devilix.net>2016-12-14 15:14:13 +0100
commit24c866628d0ce5463d7e8b4eba512fa9e7752dfd (patch)
tree39d65288647ecaae09e2b9bc6a15e34e53f7d7d4 /system/core/compat
parent26313bddee1fb67af10141671a47bbe703a025fd (diff)
Drop all PHP 5.3-related code
Diffstat (limited to 'system/core/compat')
-rw-r--r--system/core/compat/hash.php2
-rw-r--r--system/core/compat/password.php2
-rw-r--r--system/core/compat/standard.php48
3 files changed, 1 insertions, 51 deletions
diff --git a/system/core/compat/hash.php b/system/core/compat/hash.php
index d567d0f80..5fec4cc67 100644
--- a/system/core/compat/hash.php
+++ b/system/core/compat/hash.php
@@ -203,8 +203,6 @@ if ( ! function_exists('hash_pbkdf2'))
'ripemd160' => 64,
'ripemd256' => 64,
'ripemd320' => 64,
- 'salsa10' => 64,
- 'salsa20' => 64,
'sha1' => 64,
'sha224' => 64,
'sha256' => 64,
diff --git a/system/core/compat/password.php b/system/core/compat/password.php
index 1b5219e7b..e58422557 100644
--- a/system/core/compat/password.php
+++ b/system/core/compat/password.php
@@ -141,7 +141,7 @@ if ( ! function_exists('password_hash'))
}
// Try not to waste entropy ...
- is_php('5.4') && stream_set_chunk_size($fp, 16);
+ stream_set_chunk_size($fp, 16);
$options['salt'] = '';
for ($read = 0; $read < 16; $read = ($func_override) ? mb_strlen($options['salt'], '8bit') : strlen($options['salt']))
diff --git a/system/core/compat/standard.php b/system/core/compat/standard.php
index 6b7caa485..ca5046e56 100644
--- a/system/core/compat/standard.php
+++ b/system/core/compat/standard.php
@@ -132,51 +132,3 @@ if ( ! function_exists('array_column'))
return $result;
}
}
-
-// ------------------------------------------------------------------------
-
-if (is_php('5.4'))
-{
- return;
-}
-
-// ------------------------------------------------------------------------
-
-if ( ! function_exists('hex2bin'))
-{
- /**
- * hex2bin()
- *
- * @link http://php.net/hex2bin
- * @param string $data
- * @return string
- */
- function hex2bin($data)
- {
- if (in_array($type = gettype($data), array('array', 'double', 'object', 'resource'), TRUE))
- {
- if ($type === 'object' && method_exists($data, '__toString'))
- {
- $data = (string) $data;
- }
- else
- {
- trigger_error('hex2bin() expects parameter 1 to be string, '.$type.' given', E_USER_WARNING);
- return NULL;
- }
- }
-
- if (strlen($data) % 2 !== 0)
- {
- trigger_error('Hexadecimal input string must have an even length', E_USER_WARNING);
- return FALSE;
- }
- elseif ( ! preg_match('/^[0-9a-f]*$/i', $data))
- {
- trigger_error('Input string must be hexadecimal string', E_USER_WARNING);
- return FALSE;
- }
-
- return pack('H*', $data);
- }
-}