]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge pull request #2921 from lonvia/case-insensitive-utf8
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 11 Dec 2022 14:57:01 +0000 (15:57 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Dec 2022 14:57:01 +0000 (15:57 +0100)
Use grapheme_stripos instead of stripos in PHP code

lib-php/Geocode.php

index ec1fa81da07fdae7b0891608d1fc66de1adfe40b..0881d20a216f5adeb77f22cf75dbc15cab0b4cc0 100644 (file)
@@ -874,7 +874,7 @@ class Geocode
                 $iCountWords = 0;
                 $sAddress = $aResult['langaddress'];
                 foreach ($aRecheckWords as $i => $sWord) {
-                    if (stripos($sAddress, $sWord)!==false) {
+                    if (grapheme_stripos($sAddress, $sWord)!==false) {
                         $iCountWords++;
                         if (preg_match('/(^|,)\s*'.preg_quote($sWord, '/').'\s*(,|$)/', $sAddress)) {
                             $iCountWords += 0.1;