Update CodeIgniter system 3.1.0 => 3.1.16

This commit is contained in:
2020-08-02 02:23:47 -04:00
parent 3523bc5f57
commit 083b534f0a
176 changed files with 2351 additions and 1889 deletions
+13 -17
View File
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
* Copyright (c) 2014 - 2019, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,8 @@
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 3.0.0
* @filesource
@@ -135,11 +135,11 @@ class CI_Encryption {
);
/**
* mbstring.func_override flag
* mbstring.func_overload flag
*
* @var bool
*/
protected static $func_override;
protected static $func_overload;
// --------------------------------------------------------------------
@@ -152,10 +152,8 @@ class CI_Encryption {
public function __construct(array $params = array())
{
$this->_drivers = array(
'mcrypt' => defined('MCRYPT_DEV_URANDOM'),
// While OpenSSL is available for PHP 5.3.0, an IV parameter
// for the encrypt/decrypt functions is only available since 5.3.3
'openssl' => (is_php('5.3.3') && extension_loaded('openssl'))
'mcrypt' => defined('MCRYPT_DEV_URANDOM'),
'openssl' => extension_loaded('openssl')
);
if ( ! $this->_drivers['mcrypt'] && ! $this->_drivers['openssl'])
@@ -163,7 +161,7 @@ class CI_Encryption {
show_error('Encryption: Unable to find an available encryption driver.');
}
isset(self::$func_override) OR self::$func_override = (extension_loaded('mbstring') && ini_get('mbstring.func_override'));
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
$this->initialize($params);
if ( ! isset($this->_key) && self::strlen($key = config_item('encryption_key')) > 0)
@@ -684,10 +682,8 @@ class CI_Encryption {
{
return FALSE;
}
else
{
$params['mode'] = $this->_modes[$this->_driver][$params['mode']];
}
$params['mode'] = $this->_modes[$this->_driver][$params['mode']];
}
if (isset($params['hmac']) && $params['hmac'] === FALSE)
@@ -909,11 +905,11 @@ class CI_Encryption {
* Byte-safe strlen()
*
* @param string $str
* @return integer
* @return int
*/
protected static function strlen($str)
{
return (self::$func_override)
return (self::$func_overload)
? mb_strlen($str, '8bit')
: strlen($str);
}
@@ -930,7 +926,7 @@ class CI_Encryption {
*/
protected static function substr($str, $start, $length = NULL)
{
if (self::$func_override)
if (self::$func_overload)
{
// mb_substr($str, $start, null, '8bit') returns an empty
// string on PHP 5.3