diff --git a/inc/error.php b/inc/error.php index 51003170..fbab934d 100644 --- a/inc/error.php +++ b/inc/error.php @@ -49,17 +49,21 @@ function error($message, $priority = true, $debug_stuff = false) { if ($config['debug']) { $debug_stuff=array(); - if(isset($db_error)){ + + if (isset($db_error)){ $debug_stuff = array_combine(array('SQLSTATE', 'Error code', 'Error message'), $db_error); } + $debug_stuff['backtrace'] = debug_backtrace(); $pw = $config['db']['password']; - $debug_callback = function(&$item) use (&$debug_callback, $pw) { - if (is_array($item)) { - return array_map($debug_callback, $item); - } - return ($item == $pw ? 'hunter2' : $item); - }; + + $debug_callback = function ($item) use (&$debug_callback, $pw) { + if (is_array($item)) { + return array_map($debug_callback, $item); + } + return ($item == $pw ? 'hunter2' : $item); + }; + $debug_stuff = array_map($debug_callback, $debug_stuff); } } diff --git a/inc/instance-config.php b/inc/instance-config.php index 4811c4aa..0be062b6 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -503,3 +503,4 @@ $config['filters'][] = array( $config['global_message'] = '

Matrix

IRC Chat

Mumble

Telegram

Discord

'; $config['spam_noticer']['website_name'] = "leftychan_dev"; +$config['debug'] = true; diff --git a/inc/mod/auth.php b/inc/mod/auth.php index 5705c8a2..339749d8 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -117,13 +117,19 @@ function setCookies() { if (!$mod) error('setCookies() was called for a non-moderator!'); - setcookie($config['cookies']['mod'], - $mod['username'] . // username - ':' . - $mod['hash'][0] . // password - ':' . - $mod['hash'][1], // salt - time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off', $config['cookies']['httponly']); + setcookie( + $config['cookies']['mod'], + $mod['username'] . // username + ':' . + $mod['hash'][0] . // password + ':' . + $mod['hash'][1], // salt + time() + $config['cookies']['expire'], + $config['cookies']['jail'] ? $config['cookies']['path'] : '/', + '', + !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off', + $config['cookies']['httponly'] + ); } function destroyCookies() {