From 84f9312e1d17725db6040554a993db38292d46bd Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Tue, 21 Nov 2006 07:30:48 -0500
Subject: [PATCH] Updated Russian localization

---
 program/include/bugs.inc |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/program/include/bugs.inc b/program/include/bugs.inc
index 819887c..946a910 100644
--- a/program/include/bugs.inc
+++ b/program/include/bugs.inc
@@ -6,7 +6,7 @@
  |                                                                       |
  | This file is part of the BQube Webmail client                         |
  | Copyright (C) 2005, BQube Dev - Switzerland                           |
- | All rights reserved.                                                  |
+ | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  |   Provide error handling and logging functions                        |
@@ -63,11 +63,21 @@
                  $arg_arr['message'],
                  $arg_arr['file'],
                  $arg_arr['line']);
-
-    if ($fp = fopen($INSTALL_PATH.'logs/errors', 'a'))
+                 
+    if (empty($CONFIG['log_dir']))
+      $CONFIG['log_dir'] = $INSTALL_PATH.'logs';
+      
+    // 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']);
       }
     }
 
@@ -93,12 +103,16 @@
   // 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();
     }
   }
 
-
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1