diff options
author | Florian Pritz <bluewind@xinu.at> | 2022-01-09 11:31:26 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2022-01-09 11:31:26 +0100 |
commit | 5fb561ed3d972659213de47cb67fdc094adfbc1e (patch) | |
tree | febd9f7e45d93801c2207691532cad144a848179 /system/libraries/Encryption.php | |
parent | 82141c4baf5a1436b6eca8b1efa6e2bff3991179 (diff) | |
parent | ad57720c57c11620c77181655d637a5bfdbe2643 (diff) |
Merge remote-tracking branch 'upstream/3.1-stable' into dev
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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 cb8ad9de9..933f6f232 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); } // -------------------------------------------------------------------- |