From: Janusz Dobrowolski Date: Fri, 25 Apr 2014 22:12:09 +0000 (+0200) Subject: Redirect all database errors to error log unless $go_debug is switched on. X-Git-Tag: 2.3-final~139 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=3c1029028fe1864ce433cd4e06b8cd3a156da9c3;p=fa-stable.git Redirect all database errors to error log unless $go_debug is switched on. --- diff --git a/includes/errors.inc b/includes/errors.inc index 08a5e578..e59e14b0 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -195,10 +195,14 @@ function display_db_error($msg, $sql_statement=null, $exit=true) } $str .= "

"; - if($msg) - trigger_error($str, E_USER_ERROR); - else // $msg can be null here only in debug mode, otherwise the error is ignored - trigger_error($str, E_USER_WARNING); + if ($go_debug) + error_log($str); + else { + if($msg) + trigger_error($str, E_USER_ERROR); + else // $msg can be null here only in debug mode, otherwise the error is ignored + trigger_error($str, E_USER_WARNING); + } if ($exit) exit; }