X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fa681ce246c98de6242af708e4e03f533bcf2d5a..a96b6a1289e3a595b2d3753a1a038abc3f19721a:/lib-php/DebugHtml.php?ds=inline diff --git a/lib-php/DebugHtml.php b/lib-php/DebugHtml.php index 5d12be67..7b0cba2d 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, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401).'

'."\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, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401); + return strlen($sOut); } }