Prevent filling debug parameter when debug is turned off in config

The debug parameter can lead to memory exhaustion errors for some errors, this prevents it happening when debug output is disabled
This commit is contained in:
discomrade 2022-02-27 09:49:36 -01:00 committed by -
parent 7ba421ff24
commit e307afd09f

View File

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