Skip to content

Commit

Permalink
Merge branch 'release/1.4.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
David McReynolds committed Sep 23, 2020
2 parents 7942b54 + 21aa9fc commit 63d9999
Show file tree
Hide file tree
Showing 38 changed files with 376 additions and 187 deletions.
23 changes: 17 additions & 6 deletions fuel/application/config/foreign_chars.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Д/' => 'D',
'/д/' => 'd',
'/Ð|Ď|Đ/' => 'Dj',
'/ð|ď|đ/' => 'dj',
'/' => 'D',
'/' => 'd',
'/Ð|Ď|Đ/' => 'Dj',
'/ð|ď|đ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
Expand All @@ -38,6 +38,8 @@
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Θ/' => 'TH',
'/θ/' => 'th',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
Expand All @@ -54,8 +56,8 @@
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|т/' => 't',
'/Ț|Ţ|Ť|Ŧ|Τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|τ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
Expand All @@ -65,6 +67,10 @@
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Φ/' => 'F',
'/φ/' => 'f',
'/Χ/' => 'CH',
'/χ/' => 'ch',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
Expand All @@ -73,10 +79,15 @@
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f',
'/Ξ/' => 'KS',
'/ξ/' => 'ks',
'/Π/' => 'P',
'/π/' => 'p',
'/Β/' => 'V',
'/β/' => 'v',
'/Μ/' => 'M',
'/μ/' => 'm',
'/Ψ/' => 'PS',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
Expand Down
2 changes: 1 addition & 1 deletion fuel/application/config/mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
'f4v' => array('video/mp4', 'video/x-f4v'),
'flv' => 'video/x-flv',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'aac' => array('audio/x-aac', 'audio/aac'),
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
Expand Down
1 change: 1 addition & 0 deletions fuel/application/config/user_agents.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
'wii' => 'Nintendo Wii',
'open web' => 'Open Web',
'openweb' => 'OpenWeb',
'meizu' => 'Meizu',

// Operating Systems
'android' => 'Android',
Expand Down
18 changes: 8 additions & 10 deletions fuel/contributing.md → fuel/codeigniter/contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Contributing to CodeIgniter


CodeIgniter is a community driven project and accepts contributions of code and documentation from the community. These contributions are made in the form of Issues or [Pull Requests](http://help.github.com/send-pull-requests/) on the [CodeIgniter repository](https://github.com/bcit-ci/CodeIgniter) on GitHub.

Issues are a quick way to point out a bug. If you find a bug or documentation error in CodeIgniter then please check a few things first:
Expand Down Expand Up @@ -59,7 +58,6 @@ If you are using [Tower](http://www.git-tower.com/) there is a "Sign-Off" checkb

By signing your work in this manner, you certify to a "Developer's Certificate of Origin". The current version of this certificate is in the `DCO.txt` file in the root of this repository.


## How-to Guide

There are two ways to make changes, the easy way and the hard way. Either way you will need to [create a GitHub account](https://github.com/signup/free).
Expand All @@ -68,15 +66,15 @@ Easy way GitHub allows in-line editing of files for making simple typo changes a

Hard way The best way to contribute is to "clone" your fork of CodeIgniter to your development area. That sounds like some jargon, but "forking" on GitHub means "making a copy of that repo to your account" and "cloning" means "copying that code to your environment so you can work on it".

1. Set up Git (Windows, Mac & Linux)
2. Go to the CodeIgniter repo
3. Fork it
4. Clone your CodeIgniter repo: [email protected]:<your-name>/CodeIgniter.git
5. Checkout the "develop" branch At this point you are ready to start making changes.
1. [Set up Git](https://help.github.com/en/articles/set-up-git) (Windows, Mac & Linux)
2. Go to the [CodeIgniter repo](https://github.com/bcit-ci/CodeIgniter)
3. [Fork it](https://help.github.com/en/articles/fork-a-repo)
4. [Clone](https://help.github.com/en/articles/fetching-a-remote#clone) your forked CodeIgniter repo: [email protected]:<your-name>/CodeIgniter.git.
5. Checkout the "develop" branch. At this point you are ready to start making changes.
6. Fix existing bugs on the Issue tracker after taking a look to see nobody else is working on them.
7. Commit the files
8. Push your develop branch to your fork
9. Send a pull request [http://help.github.com/send-pull-requests/](http://help.github.com/send-pull-requests/)
7. [Commit](https://help.github.com/en/articles/adding-a-file-to-a-repository-using-the-command-line) the files
8. [Push](https://help.github.com/en/articles/pushing-to-a-remote) your develop branch to your fork
9. [Send a pull request](https://help.github.com/en/articles/creating-a-pull-request)

The Reactor Engineers will now be alerted about the change and at least one of the team will respond. If your change fails to meet the guidelines it will be bounced, or feedback will be provided to help you improve it.

Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/core/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* @var string
*
*/
const CI_VERSION = '3.1.10';
const CI_VERSION = '3.1.11';

/*
* ------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions fuel/codeigniter/core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ class CI_Controller {
*/
private static $instance;

/**
* CI_Loader
*
* @var CI_Loader
*/
public $load;

/**
* Class constructor
*
Expand Down
4 changes: 2 additions & 2 deletions fuel/codeigniter/core/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ public function write_log($level, $msg)
* @param string $level The error level
* @param string $date Formatted date string
* @param string $message The log message
* @return string Formatted log line with a new line character '\n' at the end
* @return string Formatted log line with a new line character at the end
*/
protected function _format_line($level, $date, $message)
{
return $level.' - '.$date.' --> '.$message."\n";
return $level.' - '.$date.' --> '.$message.PHP_EOL;
}

// --------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions fuel/codeigniter/core/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public function csrf_verify()

// Check CSRF token validity, but don't error on mismatch just yet - we'll want to regenerate
$valid = isset($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name])
&& is_string($_POST[$this->_csrf_token_name]) && is_string($_COOKIE[$this->_csrf_cookie_name])
&& hash_equals($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name]);

// We kill this since we're done and we don't want to pollute the _POST array
Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/database/DB_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public function set_row($key, $value = NULL)
*/
public function custom_row_object($n, $type)
{
isset($this->custom_result_object[$type]) OR $this->custom_result_object($type);
isset($this->custom_result_object[$type]) OR $this->custom_result_object[$type] = $this->custom_result_object($type);

if (count($this->custom_result_object[$type]) === 0)
{
Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/database/drivers/mysql/mysql_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function insert_id()
*/
protected function _list_tables($prefix_limit = FALSE)
{
$sql = 'SHOW TABLES FROM '.$this->escape_identifiers($this->database);
$sql = 'SHOW TABLES FROM '.$this->_escape_char.$this->database.$this->_escape_char;

if ($prefix_limit !== FALSE && $this->dbprefix !== '')
{
Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/database/drivers/mysqli/mysqli_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public function insert_id()
*/
protected function _list_tables($prefix_limit = FALSE)
{
$sql = 'SHOW TABLES FROM '.$this->escape_identifiers($this->database);
$sql = 'SHOW TABLES FROM '.$this->_escape_char.$this->database.$this->_escape_char;

if ($prefix_limit !== FALSE && $this->dbprefix !== '')
{
Expand Down
7 changes: 7 additions & 0 deletions fuel/codeigniter/database/drivers/oci8/oci8_forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ class CI_DB_oci8_forge extends CI_DB_forge {
*/
protected $_unsigned = FALSE;

/**
* NULL value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_null = 'NULL';

// --------------------------------------------------------------------

/**
Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/database/drivers/pdo/pdo_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function field_data()

$retval[$i] = new stdClass();
$retval[$i]->name = $field['name'];
$retval[$i]->type = $field['native_type'];
$retval[$i]->type = isset($field['native_type']) ? $field['native_type'] : null;
$retval[$i]->max_length = ($field['len'] > 0) ? $field['len'] : NULL;
$retval[$i]->primary_key = (int) ( ! empty($field['flags']) && in_array('primary_key', $field['flags'], TRUE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected function _alter_table($alter_type, $table, $field)
if ( ! empty($field[$i]['default']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' SET DEFAULT '.$field[$i]['default'];
.' SET '.$field[$i]['default'];
}

if (isset($field[$i]['null']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ protected function _trans_rollback()
*/
protected function _list_tables($prefix_limit = FALSE)
{
$sql = 'SHOW TABLES';
$sql = 'SHOW TABLES FROM '.$this->_escape_char.$this->database.$this->_escape_char;

if ($prefix_limit === TRUE && $this->dbprefix !== '')
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ class CI_DB_pdo_oci_forge extends CI_DB_pdo_forge {
*/
protected $_unsigned = FALSE;

/**
* NULL value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_null = 'NULL';

// --------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function __construct($params)

if ( ! empty($this->username))
{
$this->dsn .= ';username='.$this->username;
$this->dsn .= ';user='.$this->username;
empty($this->password) OR $this->dsn .= ';password='.$this->password;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected function _alter_table($alter_type, $table, $field)
if ( ! empty($field[$i]['default']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' SET DEFAULT '.$field[$i]['default'];
.' SET '.$field[$i]['default'];
}

if (isset($field[$i]['null']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function _alter_table($alter_type, $table, $field)
if ( ! empty($field[$i]['default']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' SET DEFAULT '.$field[$i]['default'];
.' SET '.$field[$i]['default'];
}

if (isset($field[$i]['null']))
Expand Down
32 changes: 17 additions & 15 deletions fuel/codeigniter/libraries/Cache/drivers/Cache_redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ class CI_Cache_redis extends CI_Driver
*/
protected $_serialized = array();

/**
* del()/delete() method name depending on phpRedis version
*
* @var string
*/
protected static $_delete_name;

// ------------------------------------------------------------------------

/**
Expand All @@ -97,6 +104,10 @@ public function __construct()
return;
}

isset(static::$_delete_name) OR static::$_delete_name = version_compare(phpversion('phpredis'), '5', '>=')
? 'del'
: 'delete';

$CI =& get_instance();

if ($CI->config->load('redis', TRUE, TRUE))
Expand Down Expand Up @@ -135,10 +146,6 @@ public function __construct()
{
log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')');
}

// Initialize the index of serialized values.
$serialized = $this->_redis->sMembers('_ci_redis_serialized');
empty($serialized) OR $this->_serialized = array_flip($serialized);
}

// ------------------------------------------------------------------------
Expand All @@ -153,7 +160,7 @@ public function get($key)
{
$value = $this->_redis->get($key);

if ($value !== FALSE && isset($this->_serialized[$key]))
if ($value !== FALSE && $this->_redis->sIsMember('_ci_redis_serialized', $key))
{
return unserialize($value);
}
Expand Down Expand Up @@ -184,9 +191,8 @@ public function save($id, $data, $ttl = 60, $raw = FALSE)
isset($this->_serialized[$id]) OR $this->_serialized[$id] = TRUE;
$data = serialize($data);
}
elseif (isset($this->_serialized[$id]))
else
{
$this->_serialized[$id] = NULL;
$this->_redis->sRemove('_ci_redis_serialized', $id);
}

Expand All @@ -203,16 +209,12 @@ public function save($id, $data, $ttl = 60, $raw = FALSE)
*/
public function delete($key)
{
if ($this->_redis->delete($key) !== 1)
if ($this->_redis->{static::$_delete_name}($key) !== 1)
{
return FALSE;
}

if (isset($this->_serialized[$key]))
{
$this->_serialized[$key] = NULL;
$this->_redis->sRemove('_ci_redis_serialized', $key);
}
$this->_redis->sRemove('_ci_redis_serialized', $key);

return TRUE;
}
Expand All @@ -228,7 +230,7 @@ public function delete($key)
*/
public function increment($id, $offset = 1)
{
return $this->_redis->incr($id, $offset);
return $this->_redis->incrBy($id, $offset);
}

// ------------------------------------------------------------------------
Expand All @@ -242,7 +244,7 @@ public function increment($id, $offset = 1)
*/
public function decrement($id, $offset = 1)
{
return $this->_redis->decr($id, $offset);
return $this->_redis->decrBy($id, $offset);
}

// ------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions fuel/codeigniter/libraries/Form_validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,13 @@ public function valid_url($str)
$str = $matches[2];
}

// Apparently, FILTER_VALIDATE_URL doesn't reject digit-only names for some reason ...
// See https://github.com/bcit-ci/CodeIgniter/issues/5755
if (ctype_digit($str))
{
return FALSE;
}

// PHP 7 accepts IPv6 addresses within square brackets as hostnames,
// but it appears that the PR that came in with https://bugs.php.net/bug.php?id=68039
// was never merged into a PHP 5 branch ... https://3v4l.org/8PsSN
Expand Down
Loading

0 comments on commit 63d9999

Please sign in to comment.