From: Janusz Dobrowolski Date: Thu, 25 Dec 2014 19:54:22 +0000 (+0100) Subject: Database errors should be sent to log instead of screen in debug mode. X-Git-Tag: v2.4.2~19^2~302 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=e588bfb54fa9f8912c998b71537a9ad6b498eb3d;p=fa-stable.git Database errors should be sent to log instead of screen in debug mode. --- 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)