Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[-] BO : fixed accentuated URLs in products

  • Loading branch information...
commit 03101f3bab9842cbe814b90d1886f626af5d2bba 1 parent 1986ed9
Damien Metzger authored December 31, 2012

Showing 1 changed file with 26 additions and 4 deletions. Show diff stats Hide diff stats

  1. 30  js/admin.js
30  js/admin.js
@@ -27,16 +27,38 @@ var ajax_running_timeout = null;
27 27
 if (!id_language)
28 28
 	var id_language = Number(1);
29 29
 
30  
-function str2url(str,encoding,ucfirst)
  30
+function str2url(str, encoding, ucfirst)
31 31
 {
32 32
 	str = str.toUpperCase();
33 33
 	str = str.toLowerCase();
34 34
 	if (PS_ALLOW_ACCENTED_CHARS_URL)
35 35
 		str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]\\u00A1-\\uFFFF/g,'');
36  
-	else		
  36
+	else
  37
+	{
  38
+		str = str.replace(/[\u0105\u0104\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5]/g,'a');
  39
+		str = str.replace(/[\u00E7\u010D\u0107\u0106]/g,'c');
  40
+		str = str.replace(/[\u010F]/g,'d');
  41
+		str = str.replace(/[\u00E8\u00E9\u00EA\u00EB\u011B\u0119\u0118\u0117]/g,'e');
  42
+		str = str.replace(/[\u00EC\u00ED\u00EE\u00EF\u012F]/g,'i');
  43
+		str = str.replace(/[\u0142\u0141]/g,'l');
  44
+		str = str.replace(/[\u00F1\u0148]/g,'n');
  45
+		str = str.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8\u00D3]/g,'o');
  46
+		str = str.replace(/[\u0159]/g,'r');
  47
+		str = str.replace(/[\u015B\u015A\u0161]/g,'s');
  48
+		str = str.replace(/[\u00DF]/g,'ss');
  49
+		str = str.replace(/[\u0165]/g,'t');
  50
+		str = str.replace(/[\u00F9\u00FA\u00FB\u00FC\u016F\u016B\u0173]/g,'u');
  51
+		str = str.replace(/[\u00FD\u00FF]/g,'y');
  52
+		str = str.replace(/[\u017C\u017A\u017B\u0179\u017E]/g,'z');
  53
+		str = str.replace(/[\u00E6]/g,'ae');
  54
+		str = str.replace(/[\u0153]/g,'oe');
  55
+		str = str.replace(/[\u013E\u013A]/g,'l');
  56
+		str = str.replace(/[\u0155]/g,'r');
  57
+
37 58
 		str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]/g,'');
38  
-	str = str.replace(/[\u0028\u0029\u0021\u003F\u002E\u0026\u005E\u007E\u002B\u002A\u002F\u003A\u003B\u003C\u003D\u003E]/g,'');
39  
-	str = str.replace(/[\s\'\:\/\[\]-]+/g,' ');
  59
+	}
  60
+	str = str.replace(/[\u0028\u0029\u0021\u003F\u002E\u0026\u005E\u007E\u002B\u002A\u002F\u003A\u003B\u003C\u003D\u003E]/g, '');
  61
+	str = str.replace(/[\s\'\:\/\[\]-]+/g, ' ');
40 62
 
41 63
 	// Add special char not used for url rewrite
42 64
 	str = str.replace(/[ ]/g, '-');

0 notes on commit 03101f3

Please sign in to comment.
Something went wrong with that request. Please try again.