Merge remote branch 'origin/platal-0.10.2'
[platal.git] / include / geoloc.inc.php
index 4167c92..3e7f40d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -226,7 +226,7 @@ function get_address_text($adr)
         if (isset($adr['city']) && $adr['city']) $l .= $adr['city'];
     }
     if ($l) $t .= "\n".trim($l);
-    if ($adr['country'] != '00' && (!$adr['countrytxt'] || $adr['countrytxt'] == strtoupper($adr['countrytxt']))) {
+    if ($adr['country'] != '00' && (!$adr['countrytxt'] || $adr['countrytxt'] == mb_strtoupper($adr['countrytxt']))) {
         $res = XDB::query("SELECT pays FROM geoloc_pays WHERE a2 = {?}", $adr['country']);
         $adr['countrytxt'] = $res->fetchOneCell();
     }
@@ -244,8 +244,8 @@ function get_address_text($adr)
  */
 function compare_addresses_text($a, $b)
 {
-    $ta = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $a));
-    $tb = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $b));
+    $ta = mb_strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $a));
+    $tb = mb_strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $b));
 
     $la = explode("\n", $ta);
     $lb = explode("\n", $tb);