X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/db3ced17bbfff00411f506d8c84419c875959d5e..ff3230a7f3fcb314c22ab977fa014465ff274ec8:/lib-php/DebugHtml.php diff --git a/lib-php/DebugHtml.php b/lib-php/DebugHtml.php index 98da8794..7b0cba2d 100644 --- a/lib-php/DebugHtml.php +++ b/lib-php/DebugHtml.php @@ -1,4 +1,12 @@ Address TokensAddress Not'; echo 'countryoperator'; echo 'classtypepostcodehousenumber'; - foreach ($aSearches as $iRank => $aRankedSet) { + foreach ($aSearches as $aRankedSet) { foreach ($aRankedSet as $aRow) { $aRow->dumpAsHtmlTableRow($aWordsIDs); } @@ -127,7 +135,7 @@ class Debug public static function printSQL($sSQL) { - echo '

'.$sSQL.'

'."\n"; + echo '

'.date('c').' '.htmlspecialchars($sSQL, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401).'

'."\n"; } private static function outputVar($mVar, $sPreNL) @@ -170,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); } }