Database errors should be sent to log instead of screen in debug mode.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 25 Dec 2014 19:54:22 +0000 (20:54 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 28 Dec 2014 18:27:34 +0000 (19:27 +0100)
includes/errors.inc

index 1102271b658094677b6522362ce5bcf942cb7431..5deae97bfa29c8887ec878f51b9665271489b242 100644 (file)
@@ -71,9 +71,7 @@ function error_handler($errno, $errstr, $file, $line) {
                }
        }
 
-       if ($go_debug>1) {
-               $bt = get_backtrace(true, 1);
-       }
+       $bt = $go_debug>1 ? get_backtrace(true, 1) : array();
 
        // error_reporting==0 when messages are set off with @ 
        if ($errno & error_reporting()) {
@@ -196,7 +194,7 @@ function display_db_error($msg, $sql_statement=null, $exit=true)
        }
        
        $str .= "<br><br>";
-       if ($go_debug)
+       if (!$go_debug)
                error_log($str);
        else {
                if($msg)