[-] BO : Fixed bug #PSFV-367 for friendly url using a bad product name.
This commit is contained in:
+8
-6
@@ -56,12 +56,14 @@ function str2url(str,encoding,ucfirst)
|
||||
str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]\\u00A1-\\uFFFF/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,' ');
|
||||
str = str.replace(/[ ]/g,'-');
|
||||
str = str.replace(/[\/]/g,'-');
|
||||
|
||||
// Add special char not used for url rewrite
|
||||
str = str.replace(/[ ]/g, '-');
|
||||
str = str.replace(/[\/\\"'|]*/g, '');
|
||||
|
||||
if (ucfirst == 1) {
|
||||
c = str.charAt(0);
|
||||
str = c.toUpperCase()+str.slice(1);
|
||||
var first_char = str.charAt(0);
|
||||
str = first_char.toUpperCase()+str.slice(1);
|
||||
}
|
||||
|
||||
return str;
|
||||
@@ -93,8 +95,8 @@ function strToAltImgAttr(str,encoding,ucfirst)
|
||||
str = str.replace(/[\s\'\:\/\[\]-]+/g,' ');
|
||||
|
||||
if (ucfirst == 1) {
|
||||
c = str.charAt(0);
|
||||
str = c.toUpperCase()+str.slice(1);
|
||||
var first_char = str.charAt(0);
|
||||
str = first_char.toUpperCase()+str.slice(1);
|
||||
}
|
||||
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user