diff --git a/src/system/core/Benchmark.php b/src/system/core/Benchmark.php
index a5c3e999..daffa292 100644
--- a/src/system/core/Benchmark.php
+++ b/src/system/core/Benchmark.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -24,7 +25,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/benchmark.html
*/
class CI_Benchmark {
diff --git a/src/system/core/CodeIgniter.php b/src/system/core/CodeIgniter.php
index 34078174..b49c1458 100644
--- a/src/system/core/CodeIgniter.php
+++ b/src/system/core/CodeIgniter.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -23,7 +24,7 @@
* @package CodeIgniter
* @subpackage codeigniter
* @category Front-controller
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/
*/
@@ -33,7 +34,7 @@
* @var string
*
*/
- define('CI_VERSION', '2.2.0');
+ define('CI_VERSION', '2.2.1');
/**
* CodeIgniter Branch (Core = TRUE, Reactor = FALSE)
diff --git a/src/system/core/Common.php b/src/system/core/Common.php
index cd6f0e37..5e56aa09 100644
--- a/src/system/core/Common.php
+++ b/src/system/core/Common.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -23,7 +24,7 @@
* @package CodeIgniter
* @subpackage codeigniter
* @category Common Functions
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/
*/
diff --git a/src/system/core/Config.php b/src/system/core/Config.php
index 605c6cf6..50a0d8ee 100644
--- a/src/system/core/Config.php
+++ b/src/system/core/Config.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -23,7 +24,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/config.html
*/
class CI_Config {
diff --git a/src/system/core/Controller.php b/src/system/core/Controller.php
index 6ccaf975..e05362ca 100644
--- a/src/system/core/Controller.php
+++ b/src/system/core/Controller.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -24,7 +25,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/general/controllers.html
*/
class CI_Controller {
diff --git a/src/system/core/Exceptions.php b/src/system/core/Exceptions.php
index 45120968..4ca2fafb 100644
--- a/src/system/core/Exceptions.php
+++ b/src/system/core/Exceptions.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -21,7 +22,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Exceptions
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/exceptions.html
*/
class CI_Exceptions {
diff --git a/src/system/core/Hooks.php b/src/system/core/Hooks.php
index ee5c2307..4dbabb87 100644
--- a/src/system/core/Hooks.php
+++ b/src/system/core/Hooks.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -23,7 +24,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/encryption.html
*/
class CI_Hooks {
diff --git a/src/system/core/Input.php b/src/system/core/Input.php
index bf2aaf1b..40305745 100644
--- a/src/system/core/Input.php
+++ b/src/system/core/Input.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -23,7 +24,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Input
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/input.html
*/
class CI_Input {
diff --git a/src/system/core/Lang.php b/src/system/core/Lang.php
index ef5d1080..28497034 100644
--- a/src/system/core/Lang.php
+++ b/src/system/core/Lang.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -21,7 +22,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Language
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/language.html
*/
class CI_Lang {
diff --git a/src/system/core/Loader.php b/src/system/core/Loader.php
index b5b0634e..40090db6 100644
--- a/src/system/core/Loader.php
+++ b/src/system/core/Loader.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -22,7 +23,7 @@
*
* @package CodeIgniter
* @subpackage Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @category Loader
* @link http://codeigniter.com/user_guide/libraries/loader.html
*/
diff --git a/src/system/core/Model.php b/src/system/core/Model.php
index 1f142509..9bbb1fcd 100644
--- a/src/system/core/Model.php
+++ b/src/system/core/Model.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -21,7 +22,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/config.html
*/
class CI_Model {
diff --git a/src/system/core/Output.php b/src/system/core/Output.php
index 7959befb..fc88f6e5 100644
--- a/src/system/core/Output.php
+++ b/src/system/core/Output.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -23,7 +24,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Output
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/output.html
*/
class CI_Output {
diff --git a/src/system/core/Router.php b/src/system/core/Router.php
index b48a3456..b39dc163 100644
--- a/src/system/core/Router.php
+++ b/src/system/core/Router.php
@@ -5,8 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
+ * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -22,7 +23,7 @@
*
* @package CodeIgniter
* @subpackage Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @category Libraries
* @link http://codeigniter.com/user_guide/general/routing.html
*/
diff --git a/src/system/core/Security.php b/src/system/core/Security.php
index 8c6a5a3c..710d9755 100644
--- a/src/system/core/Security.php
+++ b/src/system/core/Security.php
@@ -1,12 +1,13 @@
- '[removed]',
'.parentNode' => '[removed]',
'.innerHTML' => '[removed]',
- 'window.location' => '[removed]',
'-moz-binding' => '[removed]',
'' => '-->',
@@ -90,9 +90,13 @@ class CI_Security {
*/
protected $_never_allowed_regex = array(
'javascript\s*:',
+ '(document|(document\.)?window)\.(location|on\w*)',
'expression\s*(\(|&\#40;)', // CSS and IE
'vbscript\s*:', // IE, surprise!
- 'Redirect\s+302',
+ 'wscript\s*:', // IE
+ 'jscript\s*:', // IE
+ 'vbs\s*:', // IE
+ 'Redirect\s+30\d:',
"([\"'])?data\s*:[^\\1]*?base64[^\\1]*?,[^\\1]*?\\1?"
);
@@ -263,10 +267,7 @@ class CI_Security {
*/
public function xss_clean($str, $is_image = FALSE)
{
- /*
- * Is the string an array?
- *
- */
+ // Is the string an array?
if (is_array($str))
{
while (list($key) = each($str))
@@ -277,14 +278,9 @@ class CI_Security {
return $str;
}
- /*
- * Remove Invisible Characters
- */
+ //Remove Invisible Characters
$str = remove_invisible_characters($str);
- // Validate Entities in URLs
- $str = $this->_validate_entities($str);
-
/*
* URL Decode
*
@@ -293,9 +289,12 @@ class CI_Security {
* Google
*
* Note: Use rawurldecode() so it does not remove plus signs
- *
*/
- $str = rawurldecode($str);
+ do
+ {
+ $str = rawurldecode($str);
+ }
+ while (preg_match('/%[0-9a-f]{2,}/i', $str));
/*
* Convert character entities to ASCII
@@ -303,16 +302,11 @@ class CI_Security {
* This permits our tests below to work reliably.
* We only convert entities that are within tags since
* these are the ones that will pose security problems.
- *
*/
+ $str = preg_replace_callback("/[^a-z0-9>]+[a-z0-9]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str);
+ $str = preg_replace_callback('/<\w+.*/si', array($this, '_decode_entity'), $str);
- $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str);
-
- $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str);
-
- /*
- * Remove Invisible Characters Again!
- */
+ // Remove Invisible Characters Again!
$str = remove_invisible_characters($str);
/*
@@ -323,15 +317,9 @@ class CI_Security {
* NOTE: preg_replace was found to be amazingly slow here on
* large blocks of data, so we use str_replace.
*/
+ $str = str_replace("\t", ' ', $str);
- if (strpos($str, "\t") !== FALSE)
- {
- $str = str_replace("\t", ' ', $str);
- }
-
- /*
- * Capture converted string for later comparison
- */
+ // Capture converted string for later comparison
$converted_string = $str;
// Remove Strings that are never allowed
@@ -351,11 +339,11 @@ class CI_Security {
// Images have a tendency to have the PHP short opening and
// closing tags every so often so we skip those and only
// do the long opening tags.
- $str = preg_replace('/<\?(php)/i', "<?\\1", $str);
+ $str = preg_replace('/<\?(php)/i', '<?\\1', $str);
}
else
{
- $str = str_replace(array('', '?'.'>'), array('<?', '?>'), $str);
+ $str = str_replace(array('', '?'.'>'), array('<?', '?>'), $str);
}
/*
@@ -365,22 +353,18 @@ class CI_Security {
* These words are compacted back to their correct state.
*/
$words = array(
- 'javascript', 'expression', 'vbscript', 'script', 'base64',
- 'applet', 'alert', 'document', 'write', 'cookie', 'window'
+ 'javascript', 'expression', 'vbscript', 'jscript', 'wscript',
+ 'vbs', 'script', 'base64', 'applet', 'alert', 'document',
+ 'write', 'cookie', 'window', 'confirm', 'prompt'
);
foreach ($words as $word)
{
- $temp = '';
-
- for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++)
- {
- $temp .= substr($word, $i, 1)."\s*";
- }
+ $word = implode('\s*', str_split($word)).'\s*';
// We only want to do this when it is followed by a non-word character
// That way valid stuff like "dealer to" does not become "dealerto"
- $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str);
+ $str = preg_replace_callback('#('.substr($word, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str);
}
/*
@@ -388,27 +372,33 @@ class CI_Security {
* We used to do some version comparisons and use of stripos(),
* but it is dog slow compared to these simplified non-capturing
* preg_match(), especially if the pattern exists in the string
+ *
+ * Note: It was reported that not only space characters, but all in
+ * the following pattern can be parsed as separators between a tag name
+ * and its attributes: [\d\s"\'`;,\/\=\(\x00\x0B\x09\x0C]
+ * ... however, remove_invisible_characters() above already strips the
+ * hex-encoded ones, so we'll skip them below.
*/
do
{
$original = $str;
- if (preg_match("/]*?)(>|$)#si", array($this, '_js_link_removal'), $str);
+ $str = preg_replace_callback('#]+([^>]*?)(?:>|$)#si', array($this, '_js_link_removal'), $str);
}
- if (preg_match("/]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str);
+ $str = preg_replace_callback('#]*?)(?:\s?/?>|$)#si', array($this, '_js_img_removal'), $str);
}
- if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str))
+ if (preg_match('/script|xss/i', $str))
{
- $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str);
+ $str = preg_replace('#*(?:script|xss).*?>#si', '[removed]', $str);
}
}
- while($original != $str);
+ while($original !== $str);
unset($original);
@@ -424,7 +414,7 @@ class CI_Security {
* So this: