Re-add human readable parser limit report
[lhc/web/wiklou.git] / includes / OutputPage.php
index f5405d7..50f9eb9 100644 (file)
@@ -1782,7 +1782,9 @@ class OutputPage extends ContextSource {
                }
 
                // Include profiling data
-               $this->setLimitReportData( $parserOutput->getLimitReportData() );
+               if ( !$this->limitReportData ) {
+                       $this->setLimitReportData( $parserOutput->getLimitReportData() );
+               }
 
                // Link flags are ignored for now, but may in the future be
                // used to mark individual language links.
@@ -2215,6 +2217,8 @@ class OutputPage extends ContextSource {
         * @throws MWException
         */
        public function output( $return = false ) {
+               global $wgContLang;
+
                if ( $this->mDoNothing ) {
                        return $return ? '' : null;
                }
@@ -2261,7 +2265,7 @@ class OutputPage extends ContextSource {
                ob_start();
 
                $response->header( 'Content-type: ' . $config->get( 'MimeType' ) . '; charset=UTF-8' );
-               $response->header( 'Content-language: ' . $config->get( 'ContLang' )->getHtmlCode() );
+               $response->header( 'Content-language: ' . $wgContLang->getHtmlCode() );
 
                // Avoid Internet Explorer "compatibility view" in IE 8-10, so that
                // jQuery etc. can work correctly.
@@ -2356,7 +2360,7 @@ class OutputPage extends ContextSource {
         * Output a standard error page
         *
         * showErrorPage( 'titlemsg', 'pagetextmsg' );
-        * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) );
+        * showErrorPage( 'titlemsg', 'pagetextmsg', [ 'param1', 'param2' ] );
         * showErrorPage( 'titlemsg', $messageObject );
         * showErrorPage( $titleMessageObject, $messageObject );
         *
@@ -2927,12 +2931,14 @@ class OutputPage extends ContextSource {
                        }
                }
 
-               $chunks[] = ResourceLoader::makeInlineScript(
-                       ResourceLoader::makeConfigSetScript(
-                               [ 'wgPageParseReport' => $this->limitReportData ],
-                               true
-                       )
-               );
+               if ( $this->limitReportData ) {
+                       $chunks[] = ResourceLoader::makeInlineScript(
+                               ResourceLoader::makeConfigSetScript(
+                                       [ 'wgPageParseReport' => $this->limitReportData ],
+                                       true
+                               )
+                       );
+               }
 
                return self::combineWrappedStrings( $chunks );
        }