summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2012-04-06 22:43:56 +0000
committerUrban Müller2012-04-06 22:43:56 +0000
commit9f13a3b384785321fbfdd0344e95d58c58bc5086 (patch)
treea414f0a3d07c1b4fbc5bd6028f448735cffced87
parent3a64523a3ece162a8ab743215602cbcdb30b78ab (diff)
downloaditools-9f13a3b384785321fbfdd0344e95d58c58bc5086.tar.gz
itools-9f13a3b384785321fbfdd0344e95d58c58bc5086.tar.bz2
itools-9f13a3b384785321fbfdd0344e95d58c58bc5086.zip
handle errmsg containing latin1
-rw-r--r--it.class10
1 files changed, 3 insertions, 7 deletions
diff --git a/it.class b/it.class
index fdb9cc2..787d748 100644
--- a/it.class
+++ b/it.class
@@ -225,7 +225,7 @@ static function error($p = array(), $body = null, $to = null) # $body and $to de
$body .= $_COOKIE ? "\$_COOKIE: " . var_export($_COOKIE, true) . "\n\n" : "";
$body .= $_SERVER ? "\$_SERVER: " . var_export($_SERVER, true) . "\n\n" : "";
$body .= $fulltrace ? "Stack: " . print_r($fulltrace, true) . "\n\n" : "";
- $body = it::replace(array('(pw|passw|password|secret)\] => .*' => '$1] => ********'), $body);
+ $body = it::replace(array('(pw|passw|password|secret)\] => .*' => '$1] => ********'), $body, array('utf8' => false));
}
it::mail(array('To' => $p['to'], 'Subject' => substr($p['title'], 0, 80), 'Body' => $body, 'Cc' => $GLOBALS['it_defaultconfig']['error_cc'], 'forcemail' => !it::is_devel()));
@@ -239,12 +239,8 @@ static function error($p = array(), $body = null, $to = null) # $body and $to de
if ($_SERVER['REMOTE_ADDR'])
error_log("it::error: " . $p['title'] . " Url: $url");
- if (($fh = fopen("/tmp/alertdata/alert.log", "a")))
- {
- fputs($fh, it::date() . " " . $p['title'] . " in " . ($trace ? $trace : "{$p['file']}:{$p['line']} Url: $url") . "\n");
- fclose($fh);
- @chmod("/tmp/alertdata/alert.log", 0777);
- }
+ file_put_contents("/tmp/alertdata/alert.log", it::date() . " " . $p['title'] . " in " . ($trace ? $trace : "{$p['file']}:{$p['line']} Url: $url") . "\n", FILE_APPEND);
+ @chmod("/tmp/alertdata/alert.log", 0777);
}