diff --git a/Sources/IntegrationHook.php b/Sources/IntegrationHook.php index e13ace10db..2444db6f93 100644 --- a/Sources/IntegrationHook.php +++ b/Sources/IntegrationHook.php @@ -77,7 +77,7 @@ public function __construct(string $name, ?bool $ignore_errors = null) $this->ignore_errors = $ignore_errors ?? !empty(Utils::$context['ignore_hook_errors']); - if (Config::$db_show_debug === true) { + if (!empty(Config::$db_show_debug)) { Utils::$context['debug']['hooks'][] = $name; } diff --git a/Sources/TaskRunner.php b/Sources/TaskRunner.php index 54172ab301..2ea5b2345a 100644 --- a/Sources/TaskRunner.php +++ b/Sources/TaskRunner.php @@ -161,7 +161,7 @@ public function __construct() $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0'; } - Config::$db_show_debug = null; + Config::$db_show_debug = false; Db::load(); diff --git a/Sources/Theme.php b/Sources/Theme.php index 1c6c5e6a23..f8ae4bff29 100644 --- a/Sources/Theme.php +++ b/Sources/Theme.php @@ -351,7 +351,7 @@ public static function loadTemplate(string|bool $template_name, array|string $st } if ($loaded) { - if (Config::$db_show_debug === true) { + if (!empty(Config::$db_show_debug)) { Utils::$context['debug']['templates'][] = basename($template_dir) . '/' . $template_name . '.template.php'; } @@ -406,7 +406,7 @@ public static function loadTemplate(string|bool $template_name, array|string $st */ public static function loadSubTemplate(string $sub_template_name, bool|string $fatal = false): void { - if (Config::$db_show_debug === true) { + if (!empty(Config::$db_show_debug)) { Utils::$context['debug']['sub_templates'][] = $sub_template_name; } @@ -1637,7 +1637,7 @@ function ($a, $b) { } } - if (Config::$db_show_debug === true) { + if (!empty(Config::$db_show_debug)) { // Try to keep only what's useful. $repl = [Config::$boardurl . '/Themes/' => '', Config::$boardurl . '/' => '']; diff --git a/Sources/Utils.php b/Sources/Utils.php index 55775bc4bd..eee5962495 100644 --- a/Sources/Utils.php +++ b/Sources/Utils.php @@ -2060,7 +2060,7 @@ function ($m) { header('location: ' . str_replace(' ', '%20', $setLocation), true, $permanent ? 301 : 302); // Debugging. - if (isset(Config::$db_show_debug) && Config::$db_show_debug === true) { + if (!empty(Config::$db_show_debug)) { $_SESSION['debug_redirect'] = Db::$cache; } @@ -2254,7 +2254,7 @@ public static function getCallable(mixed $input, ?bool $ignore_errors = null): m Utils::$context['instances'][$class] = new $class(); // Add another one to the list. - if (Config::$db_show_debug === true) { + if (!empty(Config::$db_show_debug)) { if (!isset(Utils::$context['debug']['instances'])) { Utils::$context['debug']['instances'] = []; }