summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2024-04-03 15:38:42 +0200
committerUrban Müller2024-04-03 15:38:42 +0200
commit3eba0fd72e667b4c2f3362c7cd4db4e989af56eb (patch)
tree4cfd9c44831ec677d1070087a641fa8379e1ec71 /it.class
parent57ef029c8b8e9892dcc891e6783e38c878aa5b1b (diff)
downloaditools-3eba0fd72e667b4c2f3362c7cd4db4e989af56eb.tar.gz
itools-3eba0fd72e667b4c2f3362c7cd4db4e989af56eb.tar.bz2
itools-3eba0fd72e667b4c2f3362c7cd4db4e989af56eb.zip
use json for superglobal output
Diffstat (limited to 'it.class')
-rw-r--r--it.class12
1 files changed, 6 insertions, 6 deletions
diff --git a/it.class b/it.class
index 9e5efb7..0351b57 100644
--- a/it.class
+++ b/it.class
@@ -296,13 +296,13 @@ static function error($p = array(), $extra = null)
$body .= ($traceline and $t = it::exec('grep -h {0} `ls 2>/dev/null {1}/log/alertlog-*|tail -3` /dev/null 2>/dev/null | grep ^2 | cut -d : -f 1-2 | sort | uniq -c | tail -10', $traceline, $home)) ? "Histogram: (last 10 affected minutes in 3 days)\n$t\n" : "";
$body .= $mediumstack ? "Stack:\n " . it::replace(["\n" => "\n "], $mediumstack) . "\n" : "";
- $body .= $_GET ? "\$_GET: " . var_export($_GET, true) . "\n\n" : "";
- $body .= $_POST ? "\$_POST: " . var_export($_POST, true) . "\n\n" : "";
- $body .= $reqbody ? "\$reqbody: " . var_export($reqbody, true) . "\n\n" : "";
- $body .= $_COOKIE ? "\$_COOKIE: " . var_export($_COOKIE, true) . "\n\n" : "";
+ $body .= $_GET ? "\$_GET: " . it::json_encode($_GET, ['pretty' => true]) . "\n\n" : "";
+ $body .= $_POST ? "\$_POST: " . it::json_encode($_POST, ['pretty' => true]) . "\n\n" : "";
+ $body .= $reqbody ? "\$reqbody: " . it::json_encode($reqbody, ['pretty' => true]) . "\n\n" : "";
+ $body .= $_COOKIE ? "\$_COOKIE: " . it::json_encode($_COOKIE, ['pretty' => true]) . "\n\n" : "";
$body .= $_SERVER['REMOTE_ADDR'] ? "" : "Pstree:\n" . it::exec("pstree -als {pid} | head -n -3", ['pid' => getmypid()]) . "\n";
- $body .= $_SERVER ? "\$_SERVER: " . var_export($_SERVER, true) . "\n\n" : "";
- $body .= $_FILES ? "\$_FILES: " . var_export($_FILES, true) . "\n\n" : "";
+ $body .= $_SERVER ? "\$_SERVER: " . it::json_encode($_SERVER, ['pretty' => true]) . "\n\n" : "";
+ $body .= $_FILES ? "\$_FILES: " . it::json_encode($_FILES, ['pretty' => true]) . "\n\n" : "";
$body .= "Processes:\n" . it::exec('ps auxf | egrep -v "rotatelogs|getbanner|logaction|httpd|systemd|sd-pam"|egrep "^www|^cron"') . "\n";
$body .= $longstack ? "Full stack: " . "$longstack\n" : "";
$body = it::replace(array('(pw|passw|password\d*|secret)(\' => |\] => |=)[^&\s]*' => '$1$2********'), $body, array('utf8' => false));