summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/include/bugs.inc8
-rw-r--r--program/steps/mail/sendmail.inc2
2 files changed, 8 insertions, 2 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']);
+ }
}
/*
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 8ec30b0a7..6a3b51123 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -283,7 +283,7 @@ if ($CONFIG['smtp_log'])
$mailto,
$msg_subject);
- if ($fp = fopen($CONFIG['log_dir'].'/sendmail', 'a'))
+ if ($fp = @fopen($CONFIG['log_dir'].'/sendmail', 'a'))
{
fwrite($fp, $log_entry);
fclose($fp);