From 2fbe8d10e4e926f475dc11c20a6f976009be547e Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Tue, 3 Feb 2026 09:14:21 +0200 Subject: [PATCH 1/6] Fix MYSQLI_TYPE_INTERVAL Deprecation Issue 32 --- .../database/drivers/mysqli/mysqli_result.php | 60 ++++++++++--------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index 8c4f94d18fe..9a47c7c3e3f 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -137,33 +137,39 @@ public function field_data() private static function _get_field_type($type) { static $map; - isset($map) OR $map = array( - MYSQLI_TYPE_DECIMAL => 'decimal', - MYSQLI_TYPE_BIT => 'bit', - MYSQLI_TYPE_TINY => 'tinyint', - MYSQLI_TYPE_SHORT => 'smallint', - MYSQLI_TYPE_INT24 => 'mediumint', - MYSQLI_TYPE_LONG => 'int', - MYSQLI_TYPE_LONGLONG => 'bigint', - MYSQLI_TYPE_FLOAT => 'float', - MYSQLI_TYPE_DOUBLE => 'double', - MYSQLI_TYPE_TIMESTAMP => 'timestamp', - MYSQLI_TYPE_DATE => 'date', - MYSQLI_TYPE_TIME => 'time', - MYSQLI_TYPE_DATETIME => 'datetime', - MYSQLI_TYPE_YEAR => 'year', - MYSQLI_TYPE_NEWDATE => 'date', - MYSQLI_TYPE_INTERVAL => 'interval', - MYSQLI_TYPE_ENUM => 'enum', - MYSQLI_TYPE_SET => 'set', - MYSQLI_TYPE_TINY_BLOB => 'tinyblob', - MYSQLI_TYPE_MEDIUM_BLOB => 'mediumblob', - MYSQLI_TYPE_BLOB => 'blob', - MYSQLI_TYPE_LONG_BLOB => 'longblob', - MYSQLI_TYPE_STRING => 'char', - MYSQLI_TYPE_VAR_STRING => 'varchar', - MYSQLI_TYPE_GEOMETRY => 'geometry' - ); + + if (!isset($map)) { + $map = array( + MYSQLI_TYPE_DECIMAL => 'decimal', + MYSQLI_TYPE_BIT => 'bit', + MYSQLI_TYPE_TINY => 'tinyint', + MYSQLI_TYPE_SHORT => 'smallint', + MYSQLI_TYPE_INT24 => 'mediumint', + MYSQLI_TYPE_LONG => 'int', + MYSQLI_TYPE_LONGLONG => 'bigint', + MYSQLI_TYPE_FLOAT => 'float', + MYSQLI_TYPE_DOUBLE => 'double', + MYSQLI_TYPE_TIMESTAMP => 'timestamp', + MYSQLI_TYPE_DATE => 'date', + MYSQLI_TYPE_TIME => 'time', + MYSQLI_TYPE_DATETIME => 'datetime', + MYSQLI_TYPE_YEAR => 'year', + MYSQLI_TYPE_NEWDATE => 'date', + MYSQLI_TYPE_ENUM => 'enum', + MYSQLI_TYPE_SET => 'set', + MYSQLI_TYPE_TINY_BLOB => 'tinyblob', + MYSQLI_TYPE_MEDIUM_BLOB => 'mediumblob', + MYSQLI_TYPE_BLOB => 'blob', + MYSQLI_TYPE_LONG_BLOB => 'longblob', + MYSQLI_TYPE_STRING => 'char', + MYSQLI_TYPE_VAR_STRING => 'varchar', + MYSQLI_TYPE_GEOMETRY => 'geometry' + ); + + if (defined('MYSQLI_TYPE_INTERVAL')) { + $map[MYSQLI_TYPE_INTERVAL] = 'interval'; + } + } return isset($map[$type]) ? $map[$type] : $type; } From 26003dc77570662db631ae7dd647de35721fb24b Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Tue, 3 Feb 2026 09:33:38 +0200 Subject: [PATCH 2/6] Decrypt and Encrypt null handling issue 29 --- system/libraries/Encryption.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php index 54d1aa99e49..80154fbb456 100644 --- a/system/libraries/Encryption.php +++ b/system/libraries/Encryption.php @@ -475,6 +475,8 @@ protected function _openssl_encrypt($data, $params) return FALSE; } + $data = (string) $data; + $iv = ($iv_size = openssl_cipher_iv_length($params['handle'])) ? $this->create_key($iv_size) : ''; @@ -626,6 +628,13 @@ protected function _mcrypt_decrypt($data, $params) */ protected function _openssl_decrypt($data, $params) { + if (empty($params['handle'])) + { + return FALSE; + } + + $data = (string) $data; + if ($iv_size = openssl_cipher_iv_length($params['handle'])) { $iv = self::substr($data, 0, $iv_size); @@ -636,15 +645,13 @@ protected function _openssl_decrypt($data, $params) $iv = ''; } - return empty($params['handle']) - ? FALSE - : openssl_decrypt( - $data, - $params['handle'], - $params['key'], - 1, // DO NOT TOUCH! - $iv - ); + return openssl_decrypt( + $data, + $params['handle'], + $params['key'], + 1, // DO NOT TOUCH! + $iv + ); } // -------------------------------------------------------------------- From 543e713bf7689147b2c35683ce5bfe3e99565209 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Tue, 3 Feb 2026 09:56:30 +0200 Subject: [PATCH 3/6] Allow Dynamic properties for model issue 25 --- system/core/Model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/core/Model.php b/system/core/Model.php index b2bbbd4d484..5ca24e0a46f 100644 --- a/system/core/Model.php +++ b/system/core/Model.php @@ -47,6 +47,7 @@ * @author EllisLab Dev Team * @link https://codeigniter.com/userguide3/libraries/config.html */ +#[AllowDynamicProperties] class CI_Model { /** From 179abcb1b02d4c1c7ccf03255bf02ecf7868a286 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Tue, 3 Feb 2026 10:05:57 +0200 Subject: [PATCH 4/6] null handling on join issue 24 --- system/database/DB_query_builder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index e91612d84af..aca3218ed28 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -533,6 +533,10 @@ public function from($from) */ public function join($table, $cond, $type = '', $escape = NULL) { + $type = (string) $type; + $cond = (string) $cond; + $table = (string) $table; + if ($type !== '') { $type = strtoupper(trim($type)); From cc7731d2686c2928d23aee917065142b2391f756 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Tue, 3 Feb 2026 10:11:30 +0200 Subject: [PATCH 5/6] order by null handling issue 23 --- system/database/DB_query_builder.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index aca3218ed28..661324c0909 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -1212,6 +1212,9 @@ public function or_having($key, $value = NULL, $escape = NULL) */ public function order_by($orderby, $direction = '', $escape = NULL) { + $orderby = (string) $orderby; + $direction = (string) $direction; + $direction = strtoupper(trim($direction)); if ($direction === 'RANDOM') From f8f186bc049dc5caa4a9da6dc24b9e8e06b4728b Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Mon, 9 Feb 2026 16:55:50 +0200 Subject: [PATCH 6/6] Suppress deprecated warning --- system/database/drivers/mysqli/mysqli_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index 9a47c7c3e3f..65950552f2b 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -167,7 +167,7 @@ private static function _get_field_type($type) ); if (defined('MYSQLI_TYPE_INTERVAL')) { - $map[MYSQLI_TYPE_INTERVAL] = 'interval'; + $map[constant('MYSQLI_TYPE_INTERVAL')] = 'interval'; } }