From 5a543abb776216ac365b5fbf9c94799867439f90 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 1 Nov 2010 20:35:54 +0000 Subject: [PATCH] (bug 25610) Put ResourceLoader in debug mode when resourceLoaderDebug cookie is present and set to something that evaluates to true in PHP. The ?debug= request parameter, if present, overrides this, and both override $wgResourceLoaderDebugMode --- includes/OutputPage.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index cd2a2bfc5e..6fbd5886ff 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2304,9 +2304,13 @@ class OutputPage { } // TODO: Should this be a static function of ResourceLoader instead? // TODO: Divide off modules starting with "user", and add the user parameter to them + // Determine whether we're in debug mode + // Order of priority is 1) request param, 2) cookie, 3) $wg setting + $debug = $wgRequest->getFuzzyBool( 'debug', + $wgRequest->getCookie( 'resourceLoaderModule', '', $wgResourceLoaderDebug ) ); $query = array( 'lang' => $wgLang->getCode(), - 'debug' => $wgRequest->getFuzzyBool( 'debug', $wgResourceLoaderDebug ) ? 'true' : 'false', + 'debug' => $debug ? 'true' : 'false', 'skin' => $wgUser->getSkin()->getSkinName(), 'only' => $only, ); -- 2.20.1