From 5f93ec81033fa401e85a64548c73f19e9bc1e147 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 2 Jul 2014 18:15:52 +0200 Subject: stricter condition for linking urls --- it_debug.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it_debug.class') diff --git a/it_debug.class b/it_debug.class index eacdeb1..b7df95b 100644 --- a/it_debug.class +++ b/it_debug.class @@ -81,7 +81,7 @@ static function dump($args) 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']) $plain = 1; else if ($_SERVER['REMOTE_ADDR']) - list($blue, $noblue) = array("", ""); + list($blue, $noblue, $htmlok) = array("", "", 1); else if (posix_isatty(STDOUT)) list($blue, $noblue, $red, $nored) = getenv('IT_ED_BRIGHT') ? array("\033[34m", "\033[m", "\033[33m", "\033[m") : array("\033[34m", "\033[m", "\033[31m", "\033[m"); @@ -143,7 +143,7 @@ static function dump($args) if (isset($_SERVER['REMOTE_ADDR']) && !$plain) # html encode content and link any urls $item = htmlspecialchars($item, ENT_COMPAT, "ISO-8859-1"); - if (!$plain) + if ($htmlok) $item = preg_replace("#http://[^ ']*#", "\$0", $item); if (preg_match('/^[\'"]/', $var)) -- cgit v1.2.3