Skip to content

Commit d17b26f

Browse files
committed
Merge remote-tracking branch 'origin/develop' into 3.1-stable
2 parents 75b3a64 + a2863d9 commit d17b26f

7 files changed

Lines changed: 69 additions & 45 deletions

File tree

application/config/user_agents.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
$browsers = array(
6262
'OPR' => 'Opera',
6363
'Flock' => 'Flock',
64-
'Edge' => 'Edge',
64+
'Edge' => 'Edge Legacy (Spartan)',
65+
'Edg' => 'Edge',
6566
'Chrome' => 'Chrome',
6667
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
6768
'Opera.*?Version' => 'Opera',

readme.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ interface and logical structure to access these libraries. CodeIgniter lets
1010
you creatively focus on your project by minimizing the amount of code needed
1111
for a given task.
1212

13+
The purpose of this fork is to renew the legacy CodeIgniter 3 framework. It aims to stay current with security updates, PHP versions, and maintain backward compatibility without disrupting existing codebases.
14+
1315
*******************
1416
Release Information
1517
*******************
@@ -20,22 +22,21 @@ https://github.com/NielBuys/CodeIgniter/releases
2022
Server Requirements
2123
*******************
2224

23-
PHP version 7.4 or newer (PHP 8.5 ready) is recommended.
25+
PHP version 7.4 or newer is recommended (PHP 8.5 ready).
2426

2527
************
2628
Installation
2729
************
2830

29-
CodeIgniter is installed in four steps:
31+
To update an Official CodeIgniter 3 with the Fork of CodeIgniter 3
3032

31-
1. composer require nielbuys/framework
32-
2. Change "codeigniter/framework" to "nielbuys/framework" in the "composer.json" file.
33-
3. Change in main "index.php" the following line from "$system_path = 'vendor/codeigniter/framework/system';" to "$system_path = 'vendor/nielbuys/framework/system';"
34-
4. Then run composer update.
33+
1. Change "codeigniter/framework" to "nielbuys/framework" in the "composer.json" file.
34+
2. Change in main "index.php" the following line from "$system_path = 'vendor/codeigniter/framework/system';" to "$system_path = 'vendor/nielbuys/framework/system';"
35+
3. Then run composer update.
3536

36-
or
37+
CodeIgniter is installed in four steps:
3738

38-
1. Unzip the package.
39+
1. Unzip the package or composer require nielbuys/framework.
3940
2. Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.
4041
3. Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.
4142
4. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.

system/core/Log.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ public function write_log($level, $msg)
218218

219219
$message .= $this->_format_line($level, $date, $msg);
220220

221+
$result = FALSE;
221222
for ($written = 0, $length = self::strlen($message); $written < $length; $written += $result)
222223
{
223224
if (($result = fwrite($fp, self::substr($message, $written))) === FALSE)

system/core/Model.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
* @author EllisLab Dev Team
4848
* @link https://codeigniter.com/userguide3/libraries/config.html
4949
*/
50+
#[AllowDynamicProperties]
5051
class CI_Model {
5152

5253
/**

system/database/DB_query_builder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ public function from($from)
533533
*/
534534
public function join($table, $cond, $type = '', $escape = NULL)
535535
{
536+
$type = (string) $type;
537+
$cond = (string) $cond;
538+
$table = (string) $table;
539+
536540
if ($type !== '')
537541
{
538542
$type = strtoupper(trim($type));
@@ -1208,6 +1212,9 @@ public function or_having($key, $value = NULL, $escape = NULL)
12081212
*/
12091213
public function order_by($orderby, $direction = '', $escape = NULL)
12101214
{
1215+
$orderby = (string) $orderby;
1216+
$direction = (string) $direction;
1217+
12111218
$direction = strtoupper(trim($direction));
12121219

12131220
if ($direction === 'RANDOM')

system/database/drivers/mysqli/mysqli_result.php

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -137,33 +137,39 @@ public function field_data()
137137
private static function _get_field_type($type)
138138
{
139139
static $map;
140-
isset($map) OR $map = array(
141-
MYSQLI_TYPE_DECIMAL => 'decimal',
142-
MYSQLI_TYPE_BIT => 'bit',
143-
MYSQLI_TYPE_TINY => 'tinyint',
144-
MYSQLI_TYPE_SHORT => 'smallint',
145-
MYSQLI_TYPE_INT24 => 'mediumint',
146-
MYSQLI_TYPE_LONG => 'int',
147-
MYSQLI_TYPE_LONGLONG => 'bigint',
148-
MYSQLI_TYPE_FLOAT => 'float',
149-
MYSQLI_TYPE_DOUBLE => 'double',
150-
MYSQLI_TYPE_TIMESTAMP => 'timestamp',
151-
MYSQLI_TYPE_DATE => 'date',
152-
MYSQLI_TYPE_TIME => 'time',
153-
MYSQLI_TYPE_DATETIME => 'datetime',
154-
MYSQLI_TYPE_YEAR => 'year',
155-
MYSQLI_TYPE_NEWDATE => 'date',
156-
MYSQLI_TYPE_INTERVAL => 'interval',
157-
MYSQLI_TYPE_ENUM => 'enum',
158-
MYSQLI_TYPE_SET => 'set',
159-
MYSQLI_TYPE_TINY_BLOB => 'tinyblob',
160-
MYSQLI_TYPE_MEDIUM_BLOB => 'mediumblob',
161-
MYSQLI_TYPE_BLOB => 'blob',
162-
MYSQLI_TYPE_LONG_BLOB => 'longblob',
163-
MYSQLI_TYPE_STRING => 'char',
164-
MYSQLI_TYPE_VAR_STRING => 'varchar',
165-
MYSQLI_TYPE_GEOMETRY => 'geometry'
166-
);
140+
141+
if (!isset($map)) {
142+
$map = array(
143+
MYSQLI_TYPE_DECIMAL => 'decimal',
144+
MYSQLI_TYPE_BIT => 'bit',
145+
MYSQLI_TYPE_TINY => 'tinyint',
146+
MYSQLI_TYPE_SHORT => 'smallint',
147+
MYSQLI_TYPE_INT24 => 'mediumint',
148+
MYSQLI_TYPE_LONG => 'int',
149+
MYSQLI_TYPE_LONGLONG => 'bigint',
150+
MYSQLI_TYPE_FLOAT => 'float',
151+
MYSQLI_TYPE_DOUBLE => 'double',
152+
MYSQLI_TYPE_TIMESTAMP => 'timestamp',
153+
MYSQLI_TYPE_DATE => 'date',
154+
MYSQLI_TYPE_TIME => 'time',
155+
MYSQLI_TYPE_DATETIME => 'datetime',
156+
MYSQLI_TYPE_YEAR => 'year',
157+
MYSQLI_TYPE_NEWDATE => 'date',
158+
MYSQLI_TYPE_ENUM => 'enum',
159+
MYSQLI_TYPE_SET => 'set',
160+
MYSQLI_TYPE_TINY_BLOB => 'tinyblob',
161+
MYSQLI_TYPE_MEDIUM_BLOB => 'mediumblob',
162+
MYSQLI_TYPE_BLOB => 'blob',
163+
MYSQLI_TYPE_LONG_BLOB => 'longblob',
164+
MYSQLI_TYPE_STRING => 'char',
165+
MYSQLI_TYPE_VAR_STRING => 'varchar',
166+
MYSQLI_TYPE_GEOMETRY => 'geometry'
167+
);
168+
169+
if (defined('MYSQLI_TYPE_INTERVAL')) {
170+
$map[constant('MYSQLI_TYPE_INTERVAL')] = 'interval';
171+
}
172+
}
167173

168174
return isset($map[$type]) ? $map[$type] : $type;
169175
}

system/libraries/Encryption.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ protected function _openssl_encrypt($data, $params)
475475
return FALSE;
476476
}
477477

478+
$data = (string) $data;
479+
478480
$iv = ($iv_size = openssl_cipher_iv_length($params['handle']))
479481
? $this->create_key($iv_size)
480482
: '';
@@ -626,6 +628,13 @@ protected function _mcrypt_decrypt($data, $params)
626628
*/
627629
protected function _openssl_decrypt($data, $params)
628630
{
631+
if (empty($params['handle']))
632+
{
633+
return FALSE;
634+
}
635+
636+
$data = (string) $data;
637+
629638
if ($iv_size = openssl_cipher_iv_length($params['handle']))
630639
{
631640
$iv = self::substr($data, 0, $iv_size);
@@ -636,15 +645,13 @@ protected function _openssl_decrypt($data, $params)
636645
$iv = '';
637646
}
638647

639-
return empty($params['handle'])
640-
? FALSE
641-
: openssl_decrypt(
642-
$data,
643-
$params['handle'],
644-
$params['key'],
645-
1, // DO NOT TOUCH!
646-
$iv
647-
);
648+
return openssl_decrypt(
649+
$data,
650+
$params['handle'],
651+
$params['key'],
652+
1, // DO NOT TOUCH!
653+
$iv
654+
);
648655
}
649656

650657
// --------------------------------------------------------------------

0 commit comments

Comments
 (0)