]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge pull request #905 from mtmail/illinois-li-case-insensitive
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 10 Feb 2018 14:50:42 +0000 (15:50 +0100)
committerGitHub <noreply@github.com>
Sat, 10 Feb 2018 14:50:42 +0000 (15:50 +0100)
make sure Illinois,Alabama,Louisiana state code special handling is case insensitive

1  2 
lib/Geocode.php

diff --combined lib/Geocode.php
index f2b99bdbf4ca6ab382dddcb9ab0d84c5e8853fb9,b2eee7ba6b927162e6466c8045c23d85b2ca0b12..d5647c761edbc90a7a575edf17227eb8789f1710
@@@ -225,14 -225,14 +225,14 @@@ class Geocod
          $aViewbox = $oParams->getStringList('viewboxlbrt');
          if ($aViewbox) {
              if (count($aViewbox) != 4) {
 -                userError("Bad parmater 'viewboxlbrt'. Expected 4 coordinates.");
 +                userError("Bad parameter 'viewboxlbrt'. Expected 4 coordinates.");
              }
              $this->setViewbox($aViewbox);
          } else {
              $aViewbox = $oParams->getStringList('viewbox');
              if ($aViewbox) {
                  if (count($aViewbox) != 4) {
 -                    userError("Bad parmater 'viewbox'. Expected 4 coordinates.");
 +                    userError("Bad parameter 'viewbox'. Expected 4 coordinates.");
                  }
                  $this->setViewBox($aViewbox);
              } else {
  
          // Conflicts between US state abreviations and various words for 'the' in different languages
          if (isset($this->aLangPrefOrder['name:en'])) {
-             $sQuery = preg_replace('/(^|,)\s*il\s*(,|$)/', '\1illinois\2', $sQuery);
-             $sQuery = preg_replace('/(^|,)\s*al\s*(,|$)/', '\1alabama\2', $sQuery);
-             $sQuery = preg_replace('/(^|,)\s*la\s*(,|$)/', '\1louisiana\2', $sQuery);
+             $sQuery = preg_replace('/(^|,)\s*il\s*(,|$)/i', '\1illinois\2', $sQuery);
+             $sQuery = preg_replace('/(^|,)\s*al\s*(,|$)/i', '\1alabama\2', $sQuery);
+             $sQuery = preg_replace('/(^|,)\s*la\s*(,|$)/i', '\1louisiana\2', $sQuery);
          }
  
          // Do we have anything that looks like a lat/lon pair?