permitted uri chars problem |
[eluser]hugle[/eluser]
Hello everyone! I think I have some problems with regexp.. if I used to have: Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; But when I changed to this, to accept russian characters, I get Dissalowed chars error. Code: $config['permitted_uri_chars'] = 'АБВГҐДЕЄЁЖЗИІЫЇЙКЛМНОПРСТУФХЦЧШЩЮЯЬЪабвгґдеєёжзиіыїйклмнопрстуфхцчшщюяьъ a-z 0-9~%.:_-'; Russian characters get accepted, but not the "-" ... What I am doing wrong? Big thanks! Jaroslav
[eluser]pistolPete[/eluser]
Just tested it here, it's working, Which text encoding do you use to save the config.php file?
[eluser]hugle[/eluser]
[quote author="pistolPete" date="1234528668"]Just tested it here, it's working, Which text encoding do you use to save the config.php file?[/quote] Strange, I get disallowed error. The file is saved as UTF-8. Could it be an error ?
[eluser]pistolPete[/eluser]
No, UTF-8 is fine. Which CI Version are you using? Which routes did you setup?
[eluser]hugle[/eluser]
[quote author="pistolPete" date="1234543349"]No, UTF-8 is fine. Which CI Version are you using? Which routes did you setup?[/quote] CI version is 1.7 the routes I have which connects to this controller are: Code: $route['statji'] = "main/index"; But I think that the problem is somehow connected with regexp ![]() because if I change permitted_uri_chars = '' ; - everything works just fine ![]()
[eluser]pistolPete[/eluser]
What uri_protocol are you using? Code: $config['uri_protocol'] = ?
[eluser]pistolPete[/eluser]
Maybe there is a bug in CI, let's find out. Create a file named MY_URI.php and save it with the following contents in ./system/application/libraries/: Code: <?php This class "extends" the core class CI_URI and exits after _fetch_uri_string(). In the output you will see, which request information the webserver provides, such as REQUEST_URI, QUERY_STRING and PATH_INFO. These values also depend on your .htaccess file! Depending on your uri_protocol CI fetches the uri_string. If I lookup http://domain.com/ööö, the output looks like the attached screenshot. (I attached a screenshot because the forum converts urlencoded strings ) My .htaccess file contains: Code: RewriteEngine On After removing the file MY_URI.php again, I changed uri_protocol to different values (while still trying to lookup http://domain.com/ööö) , these are the results with the following standard setting: Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; PATH_INFO: "The URI you submitted has disallowed characters." REQUEST_URI: "404 Page Not Found" So the last one passed, but because there was no controller / route a 404 error appeared. If you look again at the attached screenshot, you see that the REQUEST_URI contains the urlencoded string which only consists of permitted characters. Please try to reproduce the same steps as above and post your results here.
[eluser]sl3dg3hamm3r[/eluser]
I reproduced your steps. Same results, BUT: REQUEST_URI seems to accept the encoded string, but the page can't be found afterwards (controller and method exists and do work fine with AUTO). Here the trace:
[eluser]pistolPete[/eluser]
I found out that in function _validate_request($segments) in Router.php there is no conversion of urlencoded strings: Code: // I added whitespaces between urlencoded strings so it doesn't get converted by the forum |
Welcome Guest, Not a member yet? Register Sign In |