From 30e75746495328e822f3684fa4e30683504c9277 Mon Sep 17 00:00:00 2001 From: sshscp15 <92885280+sshscp15@users.noreply.github.com> Date: Thu, 15 Sep 2022 17:03:32 +0000 Subject: [PATCH] Fix display warning/errors (#496) * prevent filling debug param when debug is off * fix php warning: "$item" must be passed by reference --- inc/display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/display.php b/inc/display.php index fe63e85e..63226aa4 100644 --- a/inc/display.php +++ b/inc/display.php @@ -105,7 +105,7 @@ function error($message, $priority = true, $debug_stuff = false) { } $pw = $config['db']['password']; - $debug_callback = function(&$item) use (&$debug_callback, $pw) { + $debug_callback = function($item) use (&$debug_callback, $pw) { if (is_array($item)) { $item = array_filter($item, $debug_callback); } @@ -125,7 +125,7 @@ function error($message, $priority = true, $debug_stuff = false) { 'message' => $message, 'mod' => $mod, 'board' => isset($board) ? $board : false, - 'debug' => is_array($debug_stuff) ? str_replace("\n", ' ', utf8tohtml(print_r($debug_stuff, true))) : utf8tohtml($debug_stuff) + 'debug' => $config['debug'] ? (is_array($debug_stuff) ? str_replace("\n", ' ', utf8tohtml(print_r($debug_stuff, true))) : utf8tohtml($debug_stuff)) : null )) ))); }