Welcome Guest, Not a member yet? Register   Sign In
Problem with permitted_uri_chars and Cyrilic letters
#1

[eluser]hugle[/eluser]
Hello everyone,

the default value of permitted_uri_chars is:
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

but since I needed to add Russian language support, I decided to change it to:
Code:
$config['permitted_uri_chars'] = 'a-z а-я 0-9~%.:_\-';

then I noticed, that sometimes I still get errors like 'The URI you submitted has disallowed characters.'

so I thought maybe I need to add UPPER case support, so changed it to:
Code:
$config['permitted_uri_chars'] = 'a-z а-я А-Я 0-9~%.:_\-';
again, the same, sometimes I was getting the errors : 'The URI you submitted has disallowed characters.'

Later, I didn't know that to do, co decided to go threw all alphabet, you can see it here:
Code:
А а  Б б  В в  Г г  Д д  Е е  Ё ё Ж ж  З з  И и  Й й  К к  Л л  М м Н н  О о  П п  Р р  С с  Т т  У у Ф ф  Х х  Ц ц  Ч ч  Ш ш  Щ щ  Ъ ъ Ы ы  Ь ь  Э э  Ю ю  Я я

And I decided to check letter/by latter, if error appears, and yes, there were many 'The URI you submitted has disallowed characters.' errors.... but after checking al the letters, I came to final sollution:

Code:
$config['permitted_uri_chars'] = 'a-z ртхцчшщъыэюьЁуф а-я А-Я 0-9~%.:_\-';

where could be a problem? Is it the problem with CI, PHP? or whatever else...?

thank you very much, CI version is 1.7.1

cheers,
Jaroslav
#2

[eluser]xzela[/eluser]
You may not be able to use those characters.

Check this list to see if you can find the proper URL-Encoding

http://www.w3schools.com/TAGS/ref_urlencode.asp
#3

[eluser]Phil Sturgeon[/eluser]
Does this regular expression work for you? I would love to implement it to PyroCMS if it does indeed work, as currently we list all Cyrillic characters in order to offer support for them. This would be much neater.
#4

[eluser]hugle[/eluser]
[quote author="xzela" date="1252993499"]You may not be able to use those characters.

Check this list to see if you can find the proper URL-Encoding

http://www.w3schools.com/TAGS/ref_urlencode.asp[/quote]

thanks for suggestion, I'll look into it..
#5

[eluser]hugle[/eluser]
[quote author="Phil Sturgeon" date="1253025190"]Does this regular expression work for you? I would love to implement it to PyroCMS if it does indeed work, as currently we list all Cyrillic characters in order to offer support for them. This would be much neater.[/quote]

the one I'm using is: $config['permitted_uri_chars'] = 'a-z ртхцчшщъыэюьЁуф а-я А-Я 0-9~%.:_\-';

I think I've checked all the upper/lower case chars, it's working, as for now I didn't find any nicer solution. good luck Smile

Jaroslav




Theme © iAndrew 2016 - Forum software by © MyBB