From 1c775e7d0b95bbf972f3924319a8d46f54be0dc9 Mon Sep 17 00:00:00 2001 From: Razican Date: Tue, 11 Nov 2014 12:23:05 +0200 Subject: Remove URI filter for parenthesis and dollar symbols, as talked in #47. Signed-off-by: Razican --- system/core/URI.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'system/core/URI.php') diff --git a/system/core/URI.php b/system/core/URI.php index 1817374b7..7809e17c0 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -326,13 +326,6 @@ class CI_URI { { show_error('The URI you submitted has disallowed characters.', 400); } - - // Convert programatic characters to entities and return - return str_replace( - array('$', '(', ')', '%28', '%29'), // Bad - array('$', '(', ')', '(', ')'), // Good - $str - ); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From fa11460e34b90016f185a03bc39c529577ee2cd7 Mon Sep 17 00:00:00 2001 From: Razican Date: Tue, 11 Nov 2014 12:25:40 +0200 Subject: Fixed return. Signed-off-by: Razican --- system/core/URI.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'system/core/URI.php') diff --git a/system/core/URI.php b/system/core/URI.php index 7809e17c0..067338d2a 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -326,6 +326,8 @@ class CI_URI { { show_error('The URI you submitted has disallowed characters.', 400); } + + return $str; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From bfa233f559a50ee0674a209fa56f866edc814fd9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Dec 2014 12:00:11 +0200 Subject: Further changes related to issue #47, PR #3323 - Removed a test that was created specifically for the 'convert programmatic characters to entities' feature. - Changed filter_uri() to accept by reference and to not return anything as its only purpose now is to trigger a show_error() call. - Added changelog messages and updated the upgrade instructions. --- system/core/URI.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'system/core/URI.php') diff --git a/system/core/URI.php b/system/core/URI.php index 067338d2a..790910169 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -173,8 +173,9 @@ class CI_URI { // Populate the segments array foreach (explode('/', trim($this->uri_string, '/')) as $val) { + $val = trim($val); // Filter segments for security - $val = trim($this->filter_uri($val)); + $this->filter_uri($val); if ($val !== '') { @@ -318,16 +319,14 @@ class CI_URI { * Filters segments for malicious characters. * * @param string $str - * @return string + * @return void */ - public function filter_uri($str) + public function filter_uri(&$str) { if ( ! empty($str) && ! empty($this->_permitted_uri_chars) && ! preg_match('/^['.$this->_permitted_uri_chars.']+$/i'.(UTF8_ENABLED ? 'u' : ''), $str)) { show_error('The URI you submitted has disallowed characters.', 400); } - - return $str; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From fe9309d22c1b088f5363954d6dac013c8c955894 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 Jan 2015 17:48:58 +0200 Subject: Bulk (mostly documentation) update - Remove PHP version from license notices - Bump year number in copyright notices - Recommend PHP 5.4 or newer to be used - Tell Travis-CI to test on PHP 5.3.0 instead of the latest 5.3 version Related: #3450 --- system/core/URI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/core/URI.php') diff --git a/system/core/URI.php b/system/core/URI.php index 790910169..39d1a8f30 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.2.4 or newer + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014, British Columbia Institute of Technology + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b