CodeIgniter Forums

Full Version: URI has disallowed characters?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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?