From: Sarah Hoffmann Date: Wed, 12 Oct 2016 20:25:04 +0000 (+0200) Subject: check if query is valid unicode string X-Git-Tag: deploy~411 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/cecbfb8e4c8c3265a9d9222d7dadeb11ebdd034c check if query is valid unicode string --- diff --git a/lib/Geocode.php b/lib/Geocode.php index b5f0c74f..c99a4cf7 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -773,6 +773,9 @@ class Geocode } $sQuery = $this->sQuery; + if (!preg_match('//u', $sQuery)) { + userError("Query string is not UTF-8 encoded."); + } // Conflicts between US state abreviations and various words for 'the' in different languages if (isset($this->aLangPrefOrder['name:en'])) {