summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2020-10-30 15:21:12 +0100
committerUrban Müller2020-10-30 15:21:12 +0100
commitb5eac2f8b9f2c38cc8bf95dad7240a55a9c48f89 (patch)
treecbee727dbf8f2c1d8277a744d319770a9185c1a7
parent7a90374e44f42c88ac968863c16846ad351bcaf0 (diff)
downloaditools-b5eac2f8b9f2c38cc8bf95dad7240a55a9c48f89.tar.gz
itools-b5eac2f8b9f2c38cc8bf95dad7240a55a9c48f89.tar.bz2
itools-b5eac2f8b9f2c38cc8bf95dad7240a55a9c48f89.zip
include POSTed non form data in error mails
-rw-r--r--it.class3
1 files changed, 3 insertions, 0 deletions
diff --git a/it.class b/it.class
index 7671ea8..7ef1d28 100644
--- a/it.class
+++ b/it.class
@@ -275,10 +275,13 @@ static function error($p = array())
if ($level >= $p['backtraceskip'] && $tracesize < 100000 && ($tracesize += strlen(print_r($stackframe, true))) < 100000) # save mem
$stackframes[] = $stackframe;
+ $needraw = $_SERVER['REQUEST_METHOD'] == "POST" && !it::match('application/x-www-form-urlencoded|multipart/form-data', $_REQUEST['CONTENT_TYPE']);
+
$body .= ($trace and $t = it::exec('grep -h {0} `ls /tmp/alertdata/alertlog-*|tail -3` /dev/null 2>/dev/null | grep ^2 | cut -d : -f 1-2 | sort | uniq -c | tail -10', $trace)) ? "Histogram: (last 10 affected minutes in 3 days)\n$t" : "";
$body .= "\n";
$body .= $_GET ? "\$_GET: " . var_export($_GET, true) . "\n\n" : "";
$body .= $_POST ? "\$_POST: " . var_export($_POST, true) . "\n\n" : "";
+ $body .= $needraw ? "\$rawpost:" . it::file_get_contents("php://input") . "\n\n" : "";
$body .= $_COOKIE ? "\$_COOKIE: " . var_export($_COOKIE, true) . "\n\n" : "";
$body .= $_SERVER['REMOTE_ADDR'] ? "" : "Pstree:\n" . it::exec("pstree -als " . getmypid() . " | head -n -3") . "\n";
$body .= $_SERVER ? "\$_SERVER: " . var_export($_SERVER, true) . "\n\n" : "";