1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-19 01:24:05 +01:00

Fix display warning/errors (#496)

* prevent filling debug param when debug is off

* fix php warning: "$item" must be passed by reference
This commit is contained in:
sshscp15 2022-09-15 17:03:32 +00:00 committed by GitHub
parent 401b506691
commit 30e7574649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
))
)));
}