Allowed URL Characters |
[eluser]JuanitoDelCielo[/eluser]
Hi guys. I was using the method Code: $this->uri->segment(2); And it works fine but, if the user uses uppercase in the url it changes the result. 1. http://localhost/pu/user/insert 2. http://localhost/pu/user/INSERT Both of them load the same controller/method. Reading the config file I found the regex a-z 0-9~%.:_\- so if the user uses uppercase the secound one should show a 404 page right? beacuse if doesn't =(. Code: /*
[eluser]JHackamack[/eluser]
What your seeing is only part of the query: Code: if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str)) The i at the end of the preg_match means its case insensitive and thus insert and INSERT are treated the same.
[eluser]JuanitoDelCielo[/eluser]
Thank you so much. I know about the i on regex but, I didnt know about that portion of code. To solve my problem if ( ! function_exists('mb_strtolower')) { strtolower() } else { mb_strtolower() } |
Welcome Guest, Not a member yet? Register Sign In |