summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2007-10-08 16:14:46 +0000
committerUrban Müller2007-10-08 16:14:46 +0000
commit900161934f56155c3558496901210ae2ef215d46 (patch)
tree5941c08c78d173f9698bb49357a9b18b1f3f4fee
parent46fb3f3c3f803c27a6270f21f33aa180da5ec22a (diff)
downloaditools-900161934f56155c3558496901210ae2ef215d46.tar.gz
itools-900161934f56155c3558496901210ae2ef215d46.tar.bz2
itools-900161934f56155c3558496901210ae2ef215d46.zip
correct it::error address fallback
-rw-r--r--it.class7
1 files 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()),