diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -150,7 +150,7 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate 'blockmail' => 3600, ); - $toscreen = (ini_get('display_errors') || EDC('astwin') || EDC('asdevel')) && !EDC('aslive'); + $toscreen = ini_get('display_errors') || EDC('astwin') || EDC('asdevel'); if (!$toscreen) # this error can only be sent by mail: find out if we want to suppress it { @mkdir("/tmp/alertdata"); @@ -192,13 +192,18 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate $p['title'] = "Alert: " . $p['title'] . " (on " . getenv('HOSTNAME') . ")"; unset ($p['locals']['GLOBALS'], $p['locals']['_GET'], $p['locals']['_POST'], $p['locals']['_COOKIE']); $locals = print_r($p['locals'], 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 .= $_GET ? "\$_GET: " . print_r($_GET, true) . "\n\n" : ""; $body .= $_POST ? "\$_POST: " . print_r($_POST, true) . "\n\n" : ""; $body .= $_COOKIE ? "\$_COOKIE: " . print_r($_COOKIE, true) . "\n\n" : ""; $body .= $_SERVER ? "\$_SERVER: " . print_r($_SERVER, true) . "\n\n" : ""; - $body .= $trace ? "Stack: " . print_r(debug_backtrace(), true) . "\n\n" : ""; + $body .= $fulltrace ? "Stack: " . print_r($fulltrace, true) . "\n\n" : ""; mail($p['to'], $p['title'], $body); } |