diff options
author | Urban Müller | 2007-10-09 13:05:15 +0000 |
---|---|---|
committer | Urban Müller | 2007-10-09 13:05:15 +0000 |
commit | a1580409d7631233b9da3d8d996d58402a63caf5 (patch) | |
tree | a1e4b819212b477d2570619c986ce44a48a7cde5 | |
parent | f2942a7f06a8ff3bf2fef846514684c25e67ea9b (diff) | |
download | itools-a1580409d7631233b9da3d8d996d58402a63caf5.tar.gz itools-a1580409d7631233b9da3d8d996d58402a63caf5.tar.bz2 itools-a1580409d7631233b9da3d8d996d58402a63caf5.zip |
size limit for locals
-rw-r--r-- | it.class | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -189,16 +189,17 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate if ($sendmail) # we're mailing: send maximum info { - $p['title'] .= " (on " . getenv('HOSTNAME') . ")"; - $body .= $p['locals'] ? "Locals: " . print_r($p['locals'], true) . "\n\n" : ""; + $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); + $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" : ""; - $pwentry = posix_getpwuid(posix_getuid()); - mail($p['to'], $p['title'], $body, "From: " . $pwentry['name'] ? $pwentry['name'] : posix_getuid()); + mail($p['to'], $p['title'], $body); } else if ($_SERVER['REMOTE_ADDR']) # in shell mode we rely on error_log below echo "<pre>{$p['title']}\n$body</pre>"; |