diff --git a/index.php b/index.php index 8b095a77a7..b775761838 100644 --- a/index.php +++ b/index.php @@ -73,7 +73,7 @@ case 'testing': case 'production': ini_set('display_errors', 0); - error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); + error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_NOTICE & ~E_USER_DEPRECATED); break; default: diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index b1bc2dec5a..bd6c682e3f 100644 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -72,8 +72,7 @@ class CI_Exceptions { E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', - E_USER_NOTICE => 'User Notice', - E_STRICT => 'Runtime Notice' + E_USER_NOTICE => 'User Notice' ); /** diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php index a1ad870afe..54d1aa99e4 100644 --- a/system/libraries/Encryption.php +++ b/system/libraries/Encryption.php @@ -369,7 +369,7 @@ public function create_key($length) * @param array $params Input parameters * @return string */ - public function encrypt($data, array $params = NULL) + public function encrypt($data, ?array $params = NULL) { if (($params = $this->_get_params($params)) === FALSE) { @@ -504,7 +504,7 @@ protected function _openssl_encrypt($data, $params) * @param array $params Input parameters * @return string */ - public function decrypt($data, array $params = NULL) + public function decrypt($data, ?array $params = NULL) { if (($params = $this->_get_params($params)) === FALSE) { diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 03f61e8df9..425d07e9ac 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -389,59 +389,20 @@ protected function _configure(&$params) */ protected function _configure_sid_length() { - if (PHP_VERSION_ID < 70100) - { - $hash_function = ini_get('session.hash_function'); - if (ctype_digit((string) $hash_function)) - { - if ($hash_function !== '1') - { - ini_set('session.hash_function', 1); - } - - $bits = 160; - } - elseif ( ! in_array($hash_function, hash_algos(), TRUE)) - { - ini_set('session.hash_function', 1); - $bits = 160; - } - elseif (($bits = strlen(hash($hash_function, 'dummy', false)) * 4) < 160) - { - ini_set('session.hash_function', 1); - $bits = 160; - } - - $bits_per_character = (int) ini_get('session.hash_bits_per_character'); - $sid_length = (int) ceil($bits / $bits_per_character); - } - else - { - $bits_per_character = (int) ini_get('session.sid_bits_per_character'); - $sid_length = (int) ini_get('session.sid_length'); - if (($bits = $sid_length * $bits_per_character) < 160) - { - // Add as many more characters as necessary to reach at least 160 bits - $sid_length += (int) ceil((160 % $bits) / $bits_per_character); - ini_set('session.sid_length', $sid_length); - } - } - - // Yes, 4,5,6 are the only known possible values as of 2016-10-27 - switch ($bits_per_character) - { - case 4: - $this->_sid_regexp = '[0-9a-f]'; - break; - case 5: - $this->_sid_regexp = '[0-9a-v]'; - break; - case 6: - $this->_sid_regexp = '[0-9a-zA-Z,-]'; - break; - } - - $this->_sid_regexp .= '{'.$sid_length.'}'; + $bits_per_character = (int) ini_get('session.sid_bits_per_character'); + $sid_length = (int) ini_get('session.sid_length'); + + // We force the PHP defaults. + if (PHP_VERSION_ID < 90000) { + if ($bits_per_character !== 4) { + ini_set('session.sid_bits_per_character', '4'); + } + if ($sid_length !== 32) { + ini_set('session.sid_length', '32'); + } + } + + $this->_sid_regexp = '[0-9a-f]{32}'; } // ------------------------------------------------------------------------ diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index ada6a5998b..10a21f3255 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -1,7 +1,7 @@