]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge pull request #548 from lonvia/query-ckeck-utf8
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 2 Nov 2016 18:21:29 +0000 (19:21 +0100)
committerGitHub <noreply@github.com>
Wed, 2 Nov 2016 18:21:29 +0000 (19:21 +0100)
check if query is valid unicode string

lib/Geocode.php

index 7ea39e4954b4aa9e84a3da84060fdf02766c70b1..03df675278b5b21d43780a7e905355780c592e43 100644 (file)
@@ -908,6 +908,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'])) {