[eluser]CI Samson[/eluser]
I want to overwrite the function _filter_uri of the Router class to avoid the error message "The URI you submitted has disallowed characters.". So I have created a file MY_Router.php in the libraries folder of my application with the following code:
Code:
class MY_Router extends CI_Router {
function MY_Router()
{
parent::CI_Router();
}
function _filter_uri($str)
{
if ($this->config->item('permitted_uri_chars') != '')
{
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
{
show_404();
exit();
}
}
return $str;
}
}
But it doesn't work, I see allays the same message.
Is it because the _filter_uri function is called in the constructor of the Router class ?
How can I do to show a not found page at the place of the error message without changing the core router class ?
Thank you for your help!