//added configuration to enable or disable accented char in URL

This commit is contained in:
vAugagneur
2012-11-09 12:56:15 +00:00
parent 2d65725a00
commit f94d51181c
5 changed files with 51 additions and 19 deletions
+4 -2
View File
@@ -32,8 +32,10 @@ function str2url(str,encoding,ucfirst)
{
str = str.toUpperCase();
str = str.toLowerCase();
str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]\\u00A1-\\uFFFF/g,'');
if (PS_ALLOW_ACCENTED_CHARS_URL)
str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]\\u00A1-\\uFFFF/g,'');
else
str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]/g,'');
str = str.replace(/[\u0028\u0029\u0021\u003F\u002E\u0026\u005E\u007E\u002B\u002A\u002F\u003A\u003B\u003C\u003D\u003E]/g,'');
str = str.replace(/[\s\'\:\/\[\]-]+/g,' ');