summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2022-02-24 16:05:04 +0100
committerUrban Müller2022-02-24 16:05:04 +0100
commitb9d1be1f3de685ed31c6f2e4efc3cb51a999fedc (patch)
treea157504bfb1e08a477cdc5dd3a69035c295723fc
parent2aa4bcbff33fcb4e85aed50884012ffd1c812108 (diff)
downloaditools-b9d1be1f3de685ed31c6f2e4efc3cb51a999fedc.tar.gz
itools-b9d1be1f3de685ed31c6f2e4efc3cb51a999fedc.tar.bz2
itools-b9d1be1f3de685ed31c6f2e4efc3cb51a999fedc.zip
use plaintext output for non-html web pages
-rw-r--r--it_debug.class2
1 files changed, 1 insertions, 1 deletions
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("&" => "&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'])