From 2c69095a1edf7474073451285238659d0f62ce3f Mon Sep 17 00:00:00 2001 From: Appleman1234 Date: Sun, 25 Sep 2022 13:30:13 +1000 Subject: PHP8.1 fixes from Rector --- inc/error.php | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'inc/error.php') diff --git a/inc/error.php b/inc/error.php index 37defe32..51054b7b 100644 --- a/inc/error.php +++ b/inc/error.php @@ -1,7 +1,8 @@ $message); + $data=['error'=>$message]; if(!empty($config) && $config['debug']){ $data['debug']=$debug_stuff; } - print json_encode($data); + print json_encode($data, JSON_THROW_ON_ERROR); exit(); } header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error'); - die(Element('page.html', array( - 'config' => $config, - 'title' => _('Error'), - 'subtitle' => _('An error has occured.'), - 'body' => Element('error.html', array( - 'config' => $config, - 'message' => $message, - 'mod' => $mod, - 'board' => isset($board) ? $board : false, - 'debug' => str_replace("\n", ' ', utf8tohtml(print_r($debug_stuff, true))) - )) - ))); + die(Element('page.html', ['config' => $config, 'title' => _('Error'), 'subtitle' => _('An error has occured.'), 'body' => Element('error.html', ['config' => $config, 'message' => $message, 'mod' => $mod, 'board' => $board ?? false, 'debug' => str_replace("\n", ' ', (string) utf8tohtml(print_r($debug_stuff, true)))])])); } -- cgit v1.3