From f0a9b332445977cfb05fee2dacc02667946a9cd2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 29 Jul 2009 14:19:18 +0000 Subject: PHP 5.3.0 compatibility changes --- system/libraries/URI.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/libraries/URI.php') diff --git a/system/libraries/URI.php b/system/libraries/URI.php index efc7a18b3..68b678053 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -186,7 +186,9 @@ class CI_URI { { if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) { - if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) + // preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards + // compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern + if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str)) { show_error('The URI you submitted has disallowed characters.', 400); } -- cgit v1.2.3-24-g4f1b