From 823502a40a2b9651988d2d8525960276315a4d88 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 11 Dec 2022 13:55:27 +0100 Subject: [PATCH] use grapheme_stripos instead of stripos in PHP code The stripos() does not handle non-ASCII correctly. --- lib-php/Geocode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-php/Geocode.php b/lib-php/Geocode.php index ec1fa81d..0881d20a 100644 --- a/lib-php/Geocode.php +++ b/lib-php/Geocode.php @@ -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; -- 2.39.5