rewrite and comma problem |
[eluser]wojtekk[/eluser]
hi Im making new version of old page and need redirect(301) old links to new links but old got 'commas' and i get error The URI you submitted has disallowed characters. so i change in config Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-,'; Code: A PHP Error was encountered any help? thx
[eluser]xwero[/eluser]
i think you have to escape the comma because they are using a preg function an a comma is a metacharacter. Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-\,';
[eluser]wojtekk[/eluser]
thx for quick answer but nope, still the same Code: A PHP Error was encountered
[eluser]Tomasz Topa[/eluser]
I had the same problem. The solution is to put the comma somewhere between other chars, not at the end: Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.,:_-'; Works for me.
[eluser]xwero[/eluser]
as it turns out a comma isn't a special character and the config string is quoted so there would be no reason for the error except the url itself. What is the url you test it with?
[eluser]xwero[/eluser]
If Tomasz solution works i wonder what could be the reason for this behaviour.
[eluser]Tomasz Topa[/eluser]
[quote author="xwero" date="1189177165"]If Tomasz solution works i wonder what could be the reason for this behaviour.[/quote] I needed URLs like this: Code: http://mydomainname.com/news/1,the-title-of-the-article-with-id-1.html The variables in config.php and routes.php are set like this: Quote:$config['permitted_uri_chars'] = 'a-z 0-9~%.,:_-'; And it works fine. However changing the "permitted_uri"chars" variable to any of these: Quote:$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-,'; results in the preg_match() error.
[eluser]xwero[/eluser]
I didn't doubt that your solutions works Tomasz, i was wondering why a comma at the end would cause an error. Sorry for the confusion.
[eluser]wojtekk[/eluser]
Thx Tomasz Its works Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:,_-'; Simple solution but i think thats a BIG bug
[eluser]-sek[/eluser]
Thank you for posting this. It was driving me crazy. I need a comma in my url since I am using the pagination2 module to pass data in my pagination urls. It needs to pass the location in each request so a limit query can be done, etc. Like this http://www.exampledomain.site/codeignite...ton,VA/100 for our proximity search. Although the actual values I urlencoded first...but that was not the problem, it was the disallowed character in url issue. I remembered that setting in the config, but it gave me the regex error. I agree, this is a big issue with the oversimplified pagination in CI and this bug not allowing commas, which are not unkown in urls. Also, just disallowing arbitrary characters in urls is an issue itself, since that includes data passed in the url, which may contain whitespace or any character. Steve |
Welcome Guest, Not a member yet? Register Sign In |