From: Sarah Hoffmann Date: Mon, 20 Feb 2023 15:24:43 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~75 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/89baa8445425ab9f1ac9e57eab336091d6458eaf?hp=5adc3167d833bc2fb73d4a19f3c68b1e7a42ee3e Merge remote-tracking branch 'upstream/master' --- diff --git a/lib-php/DebugHtml.php b/lib-php/DebugHtml.php index 5d12be67..2207d529 100644 --- a/lib-php/DebugHtml.php +++ b/lib-php/DebugHtml.php @@ -135,7 +135,7 @@ class Debug public static function printSQL($sSQL) { - echo '

'.date('c').' '.$sSQL.'

'."\n"; + echo '

'.date('c').' '.htmlspecialchars($sSQL).'

'."\n"; } private static function outputVar($mVar, $sPreNL) @@ -178,11 +178,12 @@ class Debug } if (is_string($mVar)) { - echo "'$mVar'"; - return strlen($mVar) + 2; + $sOut = "'$mVar'"; + } else { + $sOut = (string)$mVar; } - echo (string)$mVar; - return strlen((string)$mVar); + echo htmlspecialchars($sOut); + return strlen($sOut); } } diff --git a/nominatim/tools/special_phrases/sp_wiki_loader.py b/nominatim/tools/special_phrases/sp_wiki_loader.py index e71c2ec0..cbeaeabf 100644 --- a/nominatim/tools/special_phrases/sp_wiki_loader.py +++ b/nominatim/tools/special_phrases/sp_wiki_loader.py @@ -46,7 +46,8 @@ class SPWikiLoader: ['af', 'ar', 'br', 'ca', 'cs', 'de', 'en', 'es', 'et', 'eu', 'fa', 'fi', 'fr', 'gl', 'hr', 'hu', 'ia', 'is', 'it', 'ja', 'mk', 'nl', 'no', 'pl', - 'ps', 'pt', 'ru', 'sk', 'sl', 'sv', 'uk', 'vi'] + 'ps', 'pt', 'ru', 'sk', 'sl', 'sv', 'uk', 'vi', + 'lv', 'tr'] def generate_phrases(self) -> Iterable[SpecialPhrase]: diff --git a/test/php/Nominatim/DebugTest.php b/test/php/Nominatim/DebugTest.php index dbce890f..84e8f215 100644 --- a/test/php/Nominatim/DebugTest.php +++ b/test/php/Nominatim/DebugTest.php @@ -37,14 +37,14 @@ class DebugTest extends \PHPUnit\Framework\TestCase
Var1:  True
Var2:  False
Var3:  0
-
Var4:  'String'
-
Var5:  0 => 'one'
-       1 => 'two'
-       2 => 'three'
-
Var6:  'key' => 'value'
-       'key2' => 'value2'
+
Var4:  'String'
+
Var5:  0 => 'one'
+       1 => 'two'
+       2 => 'three'
+
Var6:  'key' => 'value'
+       'key2' => 'value2'
Var7:  me as string
-
Var8:  'value', 'value2'
+
Var8:  'value', 'value2'
EOT ); @@ -64,10 +64,10 @@ EOT public function testDebugArray() { $this->expectOutputString(<<Arr0: 'null' -
Arr1:  'key1' => 'val1'
-       'key2' => 'val2'
-       'key3' => 'val3'
+
Arr0:  'null'
+
Arr1:  'key1' => 'val1'
+       'key2' => 'val2'
+       'key3' => 'val3'
EOT ); @@ -93,12 +93,12 @@ EOT 1 -
'one'
-
'two'
+
'one'
+
'two'
-
'three'
-
'four'
+
'three'
+
'four'
Table4: @@ -109,9 +109,9 @@ EOT key3 -
'val1'
-
'val2'
-
'val3'
+
'val1'
+
'val2'
+
'val3'
@@ -147,18 +147,18 @@ EOT
group1
-
'val1'
-
'val2'
+
'val1'
+
'val2'
group1
-
'one'
-
'two'
+
'one'
+
'two'
group2
-
'val1'
-
'val2'
+
'val1'
+
'val2'
Table4: @@ -171,15 +171,15 @@ EOT
group1
-
'val1'
-
'val2'
-
'val3'
+
'val1'
+
'val2'
+
'val3'
group1
-
'val1'
-
'val2'
-
'val3'
+
'val1'
+
'val2'
+
'val3'