From 72def8e17325a12a097789800837cbb8d7df2697 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 24 Oct 2011 12:53:16 +0000 Subject: prevent $GLOBALS destruction, remote lastsent debugging --- it.class | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/it.class b/it.class index 367908d..3f9ccf0 100644 --- a/it.class +++ b/it.class @@ -184,7 +184,6 @@ static function error($p = array(), $body = null, $to = null) # $body and $to de clearstatcache(); $lastsenttime = @filemtime($lastsentfn); $sendmail = $now - $lastsenttime > $p['blockmail']; - $lastsentdebug = "Lastsent: lastsentfn=$lastsentfn now=$now lastsenttime=$lastsenttime blockmail={$p['blockmail']} sendmail=$sendmail errstampage=$errstampage\n\n"; if ($sendmail) { @unlink($lastsentfn); @@ -211,18 +210,16 @@ static function error($p = array(), $body = null, $to = null) # $body and $to de if (!$p['omitdebuginfo']) { - unset ($p['locals']['GLOBALS'], $p['locals']['_GET'], $p['locals']['_POST'], $p['locals']['_COOKIE']); - $locals = print_r($p['locals'], true); + $locals = print_r(array_diff_key((array)$p['locals'], array("GLOBALS", "_GET", "_POST", "_COOKIE")), true); if ($trace && ($fulltrace = array_slice(debug_backtrace(), $p['backtraceskip']))) while (strlen(print_r($fulltrace, true)) > 100000) array_pop($fulltrace); $body .= "Host: " . getenv('HOSTNAME') . "\n\n"; - $body .= $p['locals'] && strlen($locals) < 100000 ? "Locals: $locals\n\n" : ""; + $body .= $locals && strlen($locals) < 100000 ? "Locals: $locals\n\n" : ""; $body .= $p['id'] ? "Filter: graceperiod={$p['graceperiod']} timewindow={$p['timewindow']}\n\n" : ""; $body .= "Time: " . it::date() . "\n\n"; - $body .= $lastsentdebug; $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" : ""; -- cgit v1.2.3