use grapheme_stripos instead of stripos in PHP code

The stripos() does not handle non-ASCII correctly.
This commit is contained in:
Sarah Hoffmann 2022-12-11 13:55:27 +01:00
parent 4efad0bb95
commit 823502a40a

View File

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