Allowed URL Characters - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Allowed URL Characters (/showthread.php?tid=38526) |
Allowed URL Characters - El Forum - 02-10-2011 [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: /* Allowed URL Characters - El Forum - 02-10-2011 [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. Allowed URL Characters - El Forum - 02-10-2011 [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() } |