From e588bfb54fa9f8912c998b71537a9ad6b498eb3d Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Thu, 25 Dec 2014 20:54:22 +0100 Subject: [PATCH] Database errors should be sent to log instead of screen in debug mode. --- includes/errors.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/errors.inc b/includes/errors.inc index 1102271b..5deae97b 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -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 .= "

"; - if ($go_debug) + if (!$go_debug) error_log($str); else { if($msg) -- 2.30.2