]> git.openstreetmap.org Git - nominatim.git/commitdiff
check if query is valid unicode string
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 12 Oct 2016 20:25:04 +0000 (22:25 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 12 Oct 2016 20:25:04 +0000 (22:25 +0200)
lib/Geocode.php

index ae82498f2b847e35ab2da436377cb69d0f3857c7..ec3ce13b2bd2a15e4d8d8ef1ea4eb7567932fac1 100644 (file)
@@ -772,6 +772,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'])) {