Fix #2799 by adding conditional PCRE UTF-8 support to CI_URI::filter_uri()
Also did a tiny micro-optimization in the Utf8 class.
diff --git a/system/core/URI.php b/system/core/URI.php
index 3d6d202..c83b7a7 100644
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -320,7 +320,7 @@
*/
public function filter_uri($str)
{
- if ( ! empty($str) && ! empty($this->_permitted_uri_chars) && ! preg_match('/^['.$this->_permitted_uri_chars.']+$/i', $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);
}