Welcome Guest, Not a member yet? Register   Sign In
Roundtrip disallowed characters error
#4

[eluser]Yash[/eluser]
http://ellislab.com/forums/viewreply/410947/

You can achieve a much neater “upgrade” to this error message without hacking the core files.

Simply make a file in your application’s “libraries” directory called MY_URI.php, and fill it with:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_URI extends CI_URI {

    function _filter_uri($str)
    {
        if ($str != '' AND $this->config->item('permitted_uri_chars') != '')
        {
            if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
            {
                show_404($str);
                exit();
            }
        }
            
        return $str;
    }
    
}

?>

i.e. a direct copy of the appropriate function from the core class, but with your new addition of show_404() too.


Messages In This Thread
Roundtrip disallowed characters error - by El Forum - 07-26-2008, 11:59 AM
Roundtrip disallowed characters error - by El Forum - 07-26-2008, 12:16 PM
Roundtrip disallowed characters error - by El Forum - 07-26-2008, 12:23 PM
Roundtrip disallowed characters error - by El Forum - 07-26-2008, 12:37 PM
Roundtrip disallowed characters error - by El Forum - 07-26-2008, 12:50 PM
Roundtrip disallowed characters error - by El Forum - 07-26-2008, 12:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB