diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-03 00:22:28 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-03 00:22:28 -0400 |
| commit | 1d37e81adeea9b2a1bc1028f2bf45b47ac045ec4 (patch) | |
| tree | d4597976f069d51d25768d0fbd16e586947be655 /inc/display.php | |
| parent | 62f8ea4813092b42a2cd390a8358ce798d103f40 (diff) | |
Better error handling/displaying with $config['debug'] and $config['verbose_errors']
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/inc/display.php b/inc/display.php index 7c2665e1..4972d563 100644 --- a/inc/display.php +++ b/inc/display.php @@ -57,7 +57,7 @@ function createBoardlist($mod=false) { ); } -function error($message, $priority = true) { +function error($message, $priority = true, $debug_stuff = false) { global $board, $mod, $config; if ($config['syslog'] && $priority !== false) { @@ -71,16 +71,16 @@ function error($message, $priority = true) { } die(Element('page.html', array( - 'config'=>$config, - 'title'=>_('Error'), - 'subtitle'=>_('An error has occured.'), - 'body'=>'<center>' . - '<h2>' . _($message) . '</h2>' . - (isset($board) ? - "<p><a href=\"" . $config['root'] . - ($mod ? $config['file_mod'] . '?/' : '') . - $board['dir'] . $config['file_index'] . "\">"._("Go back")."</a>.</p>" : '') . - '</center>' + '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' => is_array($debug_stuff) ? str_replace("\n", ' ', utf8tohtml(print_r($debug_stuff, true))) : utf8tohtml($debug_stuff) + )) ))); } |
