Update database and helper functionality in CodeIgniter
Revised database drivers, query builder, and file/inflector helpers for improved consistency and functionality. Updated copyrights, links, and standardized function names including deprecating `is_countable` in favor of `word_is_countable`. Added support for new SQL features and optimized query handling.
This commit is contained in:
Executable → Regular
+13
-14
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
|
||||
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
|
||||
*
|
||||
* 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,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, 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/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Libraries
|
||||
* @author Andrey Andreev
|
||||
* @link https://codeigniter.com/user_guide/libraries/encryption.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/encryption.html
|
||||
*/
|
||||
class CI_Encryption {
|
||||
|
||||
@@ -161,7 +162,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 +477,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 +586,7 @@ class CI_Encryption {
|
||||
}
|
||||
else
|
||||
{
|
||||
$iv = NULL;
|
||||
$iv = '';
|
||||
}
|
||||
|
||||
if (mcrypt_generic_init($params['handle'], $params['key'], $iv) < 0)
|
||||
@@ -632,7 +633,7 @@ class CI_Encryption {
|
||||
}
|
||||
else
|
||||
{
|
||||
$iv = NULL;
|
||||
$iv = '';
|
||||
}
|
||||
|
||||
return empty($params['handle'])
|
||||
@@ -682,10 +683,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)
|
||||
@@ -912,8 +911,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);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user