summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2020-05-19 04:54:20 +0200
committerUrban Müller2020-05-19 04:54:20 +0200
commit241d2cd913cbda98764161e1c9d23c35156d836d (patch)
tree0c199ea3453149ccf23791c63e8e896cb351a12f /it.class
parentb7a19850c90c349890a9db8b37cf92f60dd1a1a8 (diff)
downloaditools-241d2cd913cbda98764161e1c9d23c35156d836d.tar.gz
itools-241d2cd913cbda98764161e1c9d23c35156d836d.tar.bz2
itools-241d2cd913cbda98764161e1c9d23c35156d836d.zip
prevent huge subjects, separate multiline parts
Diffstat (limited to 'it.class')
-rw-r--r--it.class2
1 files changed, 2 insertions, 0 deletions
diff --git a/it.class b/it.class
index 8ba5dd6..8f7435c 100644
--- a/it.class
+++ b/it.class
@@ -159,6 +159,7 @@ static function error($p = array())
{
$p = $origp = (array)$p;
$p['title'] = $p[0] ?: $p['title']; # handle 'it_error' => "oops" that was cast to array on the way
+ $p['title'] = grapheme_substr($p['title'], 0, 2000);
foreach (array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10), 1) as $level)
if ($level["class"] . $level["type"] . $level["function"] == "it::error")
@@ -275,6 +276,7 @@ static function error($p = array())
$body .= $p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . " (previous err: " . it::date('', $errstamp) . ")\n" : "";
$body .= $origp['blockmail'] ? "Block-resend: " . $origp['blockmail'] . " seconds\n" : "";
$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\n" : "";
+ $body .= "\n";
$body .= $_GET ? "\$_GET: " . var_export($_GET, true) . "\n\n" : "";
$body .= $_POST ? "\$_POST: " . var_export($_POST, true) . "\n\n" : "";
$body .= $_COOKIE ? "\$_COOKIE: " . var_export($_COOKIE, true) . "\n\n" : "";