diff options
author | Andrey Andreev <narf@devilix.net> | 2022-01-05 16:32:10 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2022-01-05 16:32:10 +0100 |
commit | 2fa66ba7c6840ac851ae7da2889e7fb654dcda07 (patch) | |
tree | 70573048d629ecc51804507c7868356fad323860 /system/libraries/Encryption.php | |
parent | efc96b71e4b1d13d713d8b2be01796b7d30e6f9b (diff) | |
parent | 1d0315b6b3d7003bfb348ccaf7ee30d2533635de (diff) |
Merge branch '3.1-stable' into develop
Diffstat (limited to 'system/libraries/Encryption.php')
-rw-r--r-- | system/libraries/Encryption.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php index b11588afd..7d648dfa3 100644 --- a/system/libraries/Encryption.php +++ b/system/libraries/Encryption.php @@ -161,7 +161,7 @@ class CI_Encryption { show_error('Encryption: Unable to find an available encryption driver.'); } - isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload')); + isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload')); $this->initialize($params); if ( ! isset($this->_key) && self::strlen($key = config_item('encryption_key')) > 0) @@ -476,7 +476,7 @@ class CI_Encryption { $iv = ($iv_size = openssl_cipher_iv_length($params['handle'])) ? $this->create_key($iv_size) - : NULL; + : ''; $data = openssl_encrypt( $data, @@ -585,7 +585,7 @@ class CI_Encryption { } else { - $iv = NULL; + $iv = ''; } if (mcrypt_generic_init($params['handle'], $params['key'], $iv) < 0) @@ -632,7 +632,7 @@ class CI_Encryption { } else { - $iv = NULL; + $iv = ''; } return empty($params['handle']) @@ -910,8 +910,8 @@ class CI_Encryption { protected static function strlen($str) { return (self::$func_overload) - ? mb_strlen($str, '8bit') - : strlen($str); + ? mb_strlen((string) $str, '8bit') + : strlen((string) $str); } // -------------------------------------------------------------------- |