From b9d1be1f3de685ed31c6f2e4efc3cb51a999fedc Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 24 Feb 2022 16:05:04 +0100 Subject: use plaintext output for non-html web pages --- it_debug.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it_debug.class') diff --git a/it_debug.class b/it_debug.class index b04d7b7..8894170 100644 --- a/it_debug.class +++ b/it_debug.class @@ -78,7 +78,7 @@ static function srcline($stackoffs = 0) */ static function dump($args, $p = []) { - $p += ['html' => $_SERVER['REMOTE_ADDR'] ? true : false, 'color' => true]; + $p += ['html' => $_SERVER['REMOTE_ADDR'] && !it::match('\.(xml|json|plist|itjs|txt|raw|csv)$', $_SERVER['PHP_SELF']) ? true : false, 'color' => true]; $htmlspecialchars = array("&" => "&", '<' => "<", '>' => ">"); 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']) -- cgit v1.2.3