Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into 3.1-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
NielBuys committed Feb 28, 2024
2 parents e9df1c8 + b8c6d8e commit 3f947bf
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 30 deletions.
19 changes: 5 additions & 14 deletions readme.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###################
Fork of CodeIgniter
###################
#####################
Fork of CodeIgniter 3
#####################

CodeIgniter is an Application Development Framework - a toolkit - for people
who build web sites using PHP. Its goal is to enable you to develop projects
Expand All @@ -14,16 +14,7 @@ for a given task.
Release Information
*******************

This repo contains in-development code for future releases. To download the
latest stable release please visit the `CodeIgniter Downloads
<https://codeigniter.com/download>`_ page.

**************************
Changelog and New Features
**************************

You can find a list of all changes for each release in the `user
guide change log <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst>`_.
https://github.com/NielBuys/CodeIgniter/releases

*******************
Server Requirements
Expand Down Expand Up @@ -70,7 +61,7 @@ agreement <https://github.com/NielBuys/CodeIgniter/blob/3.1-stable/license.txt>`
Resources
*********

- `User Guide <https://codeigniter.com/docs>`_
- `User Guide <https://codeigniter.com/userguide3/>`_
- `Contributing Guide <https://github.com/bcit-ci/CodeIgniter/blob/develop/contributing.md>`_
- `Language File Translations <https://github.com/bcit-ci/codeigniter3-translations>`_
- `Community Forums <http://forum.codeigniter.com/>`_
Expand Down
2 changes: 1 addition & 1 deletion system/core/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function set_cookie($name, $value = '', $expire = '', $domain = '', $path
if (is_array($name))
{
// always leave 'name' in last place, as the loop will break otherwise, due to $$item
foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'secure', 'httponly', 'name', 'samesite') as $item)
foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'secure', 'httponly', 'samesite', 'name') as $item)
{
if (isset($name[$item]))
{
Expand Down
4 changes: 2 additions & 2 deletions system/core/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class CI_Router {
*
* @var string
*/
public $directory;
public $directory = '';

/**
* Default controller (and method if specific)
Expand Down Expand Up @@ -340,7 +340,7 @@ protected function _set_default_controller()
protected function _validate_request($segments)
{
$c = count($segments);
$directory_override = isset($this->directory);
$directory_override = $this->directory !== '';

// Loop through our segments and return as soon as a controller
// is found or when such a directory doesn't exist
Expand Down
2 changes: 1 addition & 1 deletion system/core/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function csrf_set_cookie()
header('Set-Cookie: '.$this->_csrf_cookie_name.'='.$this->_csrf_hash
.'; Expires='.gmdate('D, d-M-Y H:i:s T', $expire)
.'; Max-Age='.$this->_csrf_expire
.'; Path='.rawurlencode(config_item('cookie_path'))
.'; Path='.implode('/', array_map('rawurlencode', explode('/', config_item('cookie_path'))))
.($domain === '' ? '' : '; Domain='.$domain)
.($secure_cookie ? '; Secure' : '')
.(config_item('cookie_httponly') ? '; HttpOnly' : '')
Expand Down
6 changes: 3 additions & 3 deletions system/database/DB_query_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,11 @@ protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = N
$k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL');
}

${$qb_key} = array('condition' => $prefix.$k, 'value' => $v, 'escape' => $escape);
$this->{$qb_key}[] = ${$qb_key};
$$qb_key = array('condition' => $prefix.$k, 'value' => $v, 'escape' => $escape);
$this->{$qb_key}[] = $$qb_key;
if ($this->qb_caching === TRUE)
{
$this->{$qb_cache_key}[] = ${$qb_key};
$this->{$qb_cache_key}[] = $$qb_key;
$this->qb_cache_exists[] = substr($qb_key, 3);
}

Expand Down
3 changes: 2 additions & 1 deletion system/libraries/Cache/drivers/Cache_redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class CI_Cache_redis extends CI_Driver
'host' => '127.0.0.1',
'password' => NULL,
'port' => 6379,
'timeout' => 0
'timeout' => 0.0,
'database' => 0
);

/**
Expand Down
2 changes: 1 addition & 1 deletion system/libraries/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ public function create_links()
}

// If something isn't quite right, back to the default base page.
if ( ! ctype_digit($this->cur_page) OR ($this->use_page_numbers && (int) $this->cur_page === 0))
if ( ! ctype_digit((string) $this->cur_page) OR ($this->use_page_numbers && (int) $this->cur_page === 0))
{
$this->cur_page = $base_page;
}
Expand Down
16 changes: 15 additions & 1 deletion system/libraries/Session/drivers/Session_redis_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,21 @@ public function __construct(&$params)

if ($this->_config['match_ip'] === TRUE)
{
$this->_key_prefix .= $_SERVER['REMOTE_ADDR'].':';
if (isset($matches['options']))
{
$save_path['password'] = preg_match('#auth=([^\s&]+)#', $matches['options'], $match) ? $match[1] : NULL;
$save_path['database'] = preg_match('#database=(\d+)#', $matches['options'], $match) ? (int) $match[1] : NULL;
$save_path['timeout'] = preg_match('#timeout=(\d+\.\d+)#', $matches['options'], $match) ? (float) $match[1] : 0.0;

preg_match('#prefix=([^\s&]+)#', $matches['options'], $match) && $this->_key_prefix = $match[1];
}

$this->_config['save_path'] = $save_path;

if ($this->_config['match_ip'] === TRUE)
{
$this->_key_prefix .= $_SERVER['REMOTE_ADDR'].':';
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion system/libraries/Xmlrpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ public function addScalar($val, $type = 'string')

if ($typeof != 1)
{
echo '<strong>XML_RPC_Values</strong>: not a scalar type (${typeof})<br />';
echo "<strong>XML_RPC_Values</strong>: not a scalar type ($typeof)<br />";
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions system/libraries/Xmlrpcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ public function multicall($m)
*/
public function multicall_error($err)
{
$str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
$code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode();
$str = is_string($err) ? $this->xmlrpcstr["multicall_$err"] : $err->faultString();
$code = is_string($err) ? $this->xmlrpcerr["multicall_$err"] : $err->faultCode();

$struct['faultCode'] = new XML_RPC_Values($code, 'int');
$struct['faultString'] = new XML_RPC_Values($str, 'string');
Expand Down
6 changes: 3 additions & 3 deletions tests/codeigniter/core/Security_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ public function test_xss_hash()
// Perform hash
$this->security->xss_hash();

$assertRegExp = class_exists('PHPUnit_Runner_Version')
? 'assertRegExp'
: 'assertMatchesRegularExpression';
$assertRegExp = method_exists($this, 'assertMatchesRegularExpression')
? 'assertMatchesRegularExpression'
: 'assertRegExp';
$this->$assertRegExp('#^[0-9a-f]{32}$#iS', $this->security->xss_hash);
}

Expand Down

0 comments on commit 3f947bf

Please sign in to comment.