From 3c1029028fe1864ce433cd4e06b8cd3a156da9c3 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 26 Apr 2014 00:12:09 +0200 Subject: [PATCH] Redirect all database errors to error log unless $go_debug is switched on. --- includes/errors.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; } -- 2.30.2