From f3704e18d89e4065cede8509256d7fbf483b7fe6 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 04 Apr 2006 17:46:27 -0400
Subject: [PATCH] Added labels for nextpage/previouspage

---
 program/include/bugs.inc |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/program/include/bugs.inc b/program/include/bugs.inc
index c9116d5..771f1ae 100644
--- a/program/include/bugs.inc
+++ b/program/include/bugs.inc
@@ -67,11 +67,17 @@
     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']);
       }
     }
 
@@ -97,7 +103,12 @@
   // show error if debug_mode is on
   if ($CONFIG['debug_level'] & 4)
     {
-    print "<b>$program Error in $arg_arr[file] ($arg_arr[line]):</b>&nbsp;";
+    print "<b>$program Error";
+
+    if (!empty($arg_arr['file']) && !empty($arg_arr['line']))
+      print " in $arg_arr[file] ($arg_arr[line])";
+
+    print ":</b>&nbsp;";
     print nl2br($arg_arr['message']);
     print '<br />';
     flush();

--
Gitblit v1.9.1