- LSaddon :: suppan : Correction de la méthode replaceAccents()
authorBenjamin Renard <brenard@easter-eggs.com>
Mon, 6 Oct 2008 15:18:17 +0000 (15:18 +0000)
committerBenjamin Renard <brenard@easter-eggs.com>
Mon, 6 Oct 2008 15:18:17 +0000 (15:18 +0000)
trunk/conf/config.LSaddons.php
trunk/includes/addons/LSaddons.supann.php

index a161c6a..29b83dd 100644 (file)
@@ -24,6 +24,7 @@ $GLOBALS['LSaddons']['loads'] = array (
   'samba',
   'posix',
   'ftp',
+  'supann',
   'maildir'
 );
 
index 2c6487e..52877af 100644 (file)
   * @retval string La chaine sans les accents
   */
   function replaceAccents($string){
-    return strtr($string, 'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ',
-                          'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY');
+    $replaceAccent = Array(
+      "à" => "a",
+      "á" => "a",
+      "â" => "a",
+      "ã" => "a",
+      "ä" => "a",
+      "ç" => "c",
+      "è" => "e",
+      "é" => "e",
+      "ê" => "e",
+      "ë" => "e",
+      "ì" => "i",
+      "í" => "i",
+      "î" => "i",
+      "ï" => "i",
+      "ñ" => "n",
+      "ò" => "o",
+      "ó" => "o",
+      "ô" => "o",
+      "õ" => "o",
+      "ö" => "o",
+      "ù" => "u",
+      "ú" => "u",
+      "û" => "u",
+      "ü" => "u",
+      "ý" => "y",
+      "ÿ" => "y",
+      "À" => "A",
+      "Á" => "A",
+      "Â" => "A",
+      "Ã" => "A",
+      "Ä" => "A",
+      "Ç" => "C",
+      "È" => "E",
+      "É" => "E",
+      "Ê" => "E",
+      "Ë" => "E",
+      "Ì" => "I",
+      "Í" => "I",
+      "Î" => "I",
+      "Ï" => "I",
+      "Ñ" => "N",
+      "Ò" => "O",
+      "Ó" => "O",
+      "Ô" => "O",
+      "Õ" => "O",
+      "Ö" => "O",
+      "Ù" => "U",
+      "Ú" => "U",
+      "Û" => "U",
+      "Ü" => "U",
+      "Ý" => "Y"
+    );
+    return strtr($string, $replaceAccent);
   }
-  
-
 ?>