Stable branch merged up to 2.3.21
[fa-stable.git] / includes / errors.inc
index 8b02f299148413e691d530427361fcc3a0567fef..86bfac2b0cd3fee9641c0c8bc188a2041e103a61 100644 (file)
@@ -195,10 +195,14 @@ function display_db_error($msg, $sql_statement=null, $exit=true)
        }
        
        $str .= "<br><br>";
-       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;
 }