From 900161934f56155c3558496901210ae2ef215d46 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 8 Oct 2007 16:14:46 +0000 Subject: correct it::error address fallback --- it.class | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/it.class b/it.class index 727239f..8e6bb31 100644 --- a/it.class +++ b/it.class @@ -117,7 +117,8 @@ function timerlog($label = '') /** - * Send verbose error report to browser or (if display_errors is off) by email to .diffnotice guys. All params optional. + * Send verbose error report to browser or (if display_errors is off) by email to .diffnotice gods, SERVER_ADMIN or current user + * All params optional. Single string parameter means 'title'. * @parma $p['title'] error title, one line * @param $p['body'] error body, multiline * @param $p['to'] comma separated recipient list @@ -127,7 +128,7 @@ function timerlog($label = '') * @param $p['backtraceskip'] number of stack levels to drop * @param $p['blockmail'] number of seconds to block mails after having sent a mail [3600] */ -function error($p = array(), $body = "", $to = "") +function error($p = array(), $body = null, $to = null) # $body and $to deprecated { if (!is_array($p)) $p = array('title' => $p, 'body' => $body, 'to' => $to); @@ -138,6 +139,8 @@ function error($p = array(), $body = "", $to = "") $url = $_SERVER['SCRIPT_NAME']; $gods = strtr(trim(@file_get_contents($GLOBALS['ULTRAHOME'] . "/.diffnotice")), array("\n"=>', ')); + if (!$p['to']) + unset($p['to']); # allow defaults to kick in $p += array( 'title' => "it::error", 'to' => $gods ? $gods : ($_SERVER['SERVER_ADMIN'] ? $_SERVER['SERVER_ADMIN'] : get_current_user()), -- cgit v1.2.3