]> 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>
Thu, 13 Oct 2016 19:49:51 +0000 (21:49 +0200)
lib/Geocode.php

index b5f0c74f9612a1e01e943a277c6414f5f77dbb64..c99a4cf77b8e88d5b9356c3da95977e59980bb3a 100644 (file)
@@ -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'])) {