ChangesListSpecialPage: Make maximum limit consistent (1000)
[lhc/web/wiklou.git] / includes / debug / MWDebug.php
index 7479841..ae7f948 100644 (file)
@@ -349,12 +349,11 @@ class MWDebug {
         * @param string $function
         * @param bool $isMaster
         * @param float $runTime Query run time
-        * @return int ID number of the query to pass to queryTime or -1 if the
-        *  debugger is disabled
+        * @return bool True if debugger is enabled, false otherwise
         */
        public static function query( $sql, $function, $isMaster, $runTime ) {
                if ( !self::$enabled ) {
-                       return -1;
+                       return false;
                }
 
                // Replace invalid UTF-8 chars with a square UTF-8 character
@@ -389,7 +388,7 @@ class MWDebug {
                        'time' => $runTime,
                ];
 
-               return count( self::$query ) - 1;
+               return true;
        }
 
        /**
@@ -431,7 +430,8 @@ class MWDebug {
                        // Cannot use OutputPage::addJsConfigVars because those are already outputted
                        // by the time this method is called.
                        $html = ResourceLoader::makeInlineScript(
-                               ResourceLoader::makeConfigSetScript( [ 'debugInfo' => $debugInfo ] )
+                               ResourceLoader::makeConfigSetScript( [ 'debugInfo' => $debugInfo ] ),
+                               $context->getOutput()->getCSPNonce()
                        );
                }