]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
be more strict with us state replacement hack
[nominatim.git] / website / search.php
index 71041080a1fb440adb7b1462c3cc5e3a8535d082..646eefe6a07fcaff6c0106918e3ee4bed88518a5 100755 (executable)
                 $sQuery = str_ireplace(array('New York, ny','new york, new york', 'New York ny','new york new york'), 'new york city, ny', $sQuery);
                if (isset($aLangPrefOrder['name:en']))          
                {
-                       $sQuery = preg_replace('/\\bil\\b/','illinois', $sQuery);
-                       $sQuery = preg_replace('/\\bal\\b/','alabama', $sQuery);
-                       $sQuery = preg_replace('/\\bla\\b/','louisiana', $sQuery);
-                       $sQuery = preg_replace('/\\bde louisiana\\b/','de la', $sQuery);
+                       $sQuery = preg_replace('/,\s*il\s*(,|$)/',', illinois\1', $sQuery);
+                       $sQuery = preg_replace('/,\s*al\s*(,|$)/',', alabama\1', $sQuery);
+                       $sQuery = preg_replace('/,\s*la\s*(,|$)/',', louisiana\1', $sQuery);
                }
 
                // If we have a view box create the SQL