summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrick Brennan <admin@8chan.co>2014-05-19 13:39:30 -0400
committerczaks <marcin@6irc.net>2014-05-21 08:19:09 +0200
commitf6e97b6e73be96e75ec606bda3d90126c69d7aee (patch)
tree261f4320a178497d0e95f0888c57e34ec8e0f8e0
parentc878b308bf53a1e5b64ec7eb53b8102f751574ac (diff)
SECURITY: Remove $config[db][password] when $config[debug] is TRUE
-rw-r--r--inc/display.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/inc/display.php b/inc/display.php
index bcde41d0..8a6ab2bf 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -109,6 +109,18 @@ function error($message, $priority = true, $debug_stuff = false) {
)));
}
+ $pw = $config['db']['password'];
+ $debug_callback = function(&$item) use (&$debug_callback, $pw) {
+ global $config;
+ if (is_array($item)) {
+ $item = array_filter($item, $debug_callback);
+ }
+ return ($item !== $pw || !$pw);
+ };
+
+
+ $debug_stuff = array_filter($debug_stuff, $debug_callback);
+
die(Element('page.html', array(
'config' => $config,
'title' => _('Error'),