mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-27 00:49:55 +03:00
use grapheme_stripos instead of stripos in PHP code
The stripos() does not handle non-ASCII correctly.
This commit is contained in:
parent
4efad0bb95
commit
823502a40a
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user