From f4976fb36afdb30f8740ecd17c663c9fb81cf1f8 Mon Sep 17 00:00:00 2001 From: roundcube Date: Sun, 11 Dec 2005 23:19:48 +0000 Subject: Check if log files are writeable git-svn-id: https://svn.roundcube.net/trunk@90 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/bugs.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'roundcubemail/program/include') diff --git a/roundcubemail/program/include/bugs.inc b/roundcubemail/program/include/bugs.inc index bc1a2932d..771f1aeda 100644 --- a/roundcubemail/program/include/bugs.inc +++ b/roundcubemail/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']); + } } /* -- cgit v1.2.3