diff options
author | Urban Müller | 2012-04-06 22:43:56 +0000 |
---|---|---|
committer | Urban Müller | 2012-04-06 22:43:56 +0000 |
commit | 9f13a3b384785321fbfdd0344e95d58c58bc5086 (patch) | |
tree | a414f0a3d07c1b4fbc5bd6028f448735cffced87 /it.class | |
parent | 3a64523a3ece162a8ab743215602cbcdb30b78ab (diff) | |
download | itools-9f13a3b384785321fbfdd0344e95d58c58bc5086.tar.gz itools-9f13a3b384785321fbfdd0344e95d58c58bc5086.tar.bz2 itools-9f13a3b384785321fbfdd0344e95d58c58bc5086.zip |
handle errmsg containing latin1
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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); } |