CodeIgniter Forums
URI has disallowed characters? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: URI has disallowed characters? (/thread-29755.html)



URI has disallowed characters? - El Forum - 04-20-2010

[eluser]chefnelone[/eluser]
Hello
I need the url to accept disallowed characters like: é, ñ.

I've got it working by changing in system/library/URI.php the line 192
from:
Code:
if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str));
to:
Code:
if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", rawurlencode($str)));
Just wrapped $str in the rawurlencode() function.
It does work but...
Is this a good fix?
Is there any other way to do it without writting the core?