summaryrefslogtreecommitdiff
path: root/it_debug.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_debug.class')
-rw-r--r--it_debug.class4
1 files changed, 3 insertions, 1 deletions
diff --git a/it_debug.class b/it_debug.class
index 7f51172..3cd3237 100644
--- a/it_debug.class
+++ b/it_debug.class
@@ -75,6 +75,8 @@ static function srcline($stackoffs = 0)
*/
static function dump($args)
{
+ $htmlspecialchars = array("&" => "&amp;", '<' => "&lt;", '>' => "&gt;");
+
if ((preg_match('/csv|txt|gif|jpg/', $_SERVER['PHP_SELF']) || preg_grep('#text/(calendar|css|javascript|json|plain|rfc822|xml)|application/#', headers_list()) || $GLOBALS['debug_edplain']) && !$GLOBALS['debug_edhtml'])
;
else if ($_SERVER['REMOTE_ADDR'])
@@ -137,7 +139,7 @@ static function dump($args)
$item = "$red$item$nored";
if ($htmlok)
- $item = preg_replace("#(https?:)?//[^\s']*#", "<a href='\$0'>\$0</a>", htmlspecialchars($item));
+ $item = preg_replace("#(https?:)?//[^\s']*#", "<a href='\$0'>\$0</a>", strtr($item, $htmlspecialchars)); # htmlspecialchars() does not like bad utf8
if (preg_match('/^[\'"]/', $var))
$r .= "$item ";