summaryrefslogtreecommitdiff
path: root/program/include/bugs.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-12-11 23:19:48 +0000
committerthomascube <thomas@roundcube.net>2005-12-11 23:19:48 +0000
commit9fc381f4e8712fec0e7b67c0f4e7af0980261e16 (patch)
tree4f0a39c6e6efe74ec69fdae555f8823833f425d7 /program/include/bugs.inc
parent31b2cee231cf5a154c87cccc1228df7b3bb1bf84 (diff)
Check if log files are writeable
Diffstat (limited to 'program/include/bugs.inc')
-rw-r--r--program/include/bugs.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/program/include/bugs.inc b/program/include/bugs.inc
index bc1a2932d..771f1aeda 100644
--- a/program/include/bugs.inc
+++ b/program/include/bugs.inc
@@ -67,12 +67,18 @@ function log_bug($arg_arr)
if (empty($CONFIG['log_dir']))
$CONFIG['log_dir'] = $INSTALL_PATH.'logs';
- if ($fp = fopen($CONFIG['log_dir'].'/errors', 'a'))
+ // try to open specific log file for writing
+ if ($fp = @fopen($CONFIG['log_dir'].'/errors', 'a'))
{
fwrite($fp, $log_entry);
fclose($fp);
}
+ else
+ {
+ // send error to PHPs error handler
+ trigger_error($arg_arr['message']);
+ }
}
/*