Merge "Avoid double-rendering on late exceptions"
[lhc/web/wiklou.git] / includes / OutputPage.php
index cffa744..c724207 100644 (file)
@@ -460,7 +460,7 @@ class OutputPage extends ContextSource {
         * @param string $script Raw HTML
         */
        function addScript( $script ) {
-               $this->mScripts .= $script . "\n";
+               $this->mScripts .= $script;
        }
 
        /**
@@ -516,7 +516,7 @@ class OutputPage extends ContextSource {
         * @param string $script JavaScript text, no "<script>" tags
         */
        public function addInlineScript( $script ) {
-               $this->mScripts .= Html::inlineScript( "\n$script\n" ) . "\n";
+               $this->mScripts .= Html::inlineScript( $script );
        }
 
        /**
@@ -2952,7 +2952,7 @@ class OutputPage extends ContextSource {
         * @return string HTML fragment
         */
        function getHeadScripts() {
-               return $this->getInlineHeadScripts() . "\n" . $this->getExternalHeadScripts();
+               return $this->getInlineHeadScripts() . $this->getExternalHeadScripts();
        }
 
        /**
@@ -3219,7 +3219,8 @@ class OutputPage extends ContextSource {
                        'wgMonthNames' => $lang->getMonthNamesArray(),
                        'wgMonthNamesShort' => $lang->getMonthAbbreviationsArray(),
                        'wgRelevantPageName' => $relevantTitle->getPrefixedDBkey(),
-                       'wgRelevantArticleId' => $relevantTitle->getArticleId(),
+                       'wgRelevantArticleId' => $relevantTitle->getArticleID(),
+                       'wgRequestId' => WebRequest::getRequestId(),
                ];
 
                if ( $user->isLoggedIn() ) {
@@ -3634,7 +3635,7 @@ class OutputPage extends ContextSource {
                        # If wanted, and the interface is right-to-left, flip the CSS
                        $style_css = CSSJanus::transform( $style_css, true, false );
                }
-               $this->mInlineStyles .= Html::inlineStyle( $style_css ) . "\n";
+               $this->mInlineStyles .= Html::inlineStyle( $style_css );
        }
 
        /**
@@ -3686,7 +3687,7 @@ class OutputPage extends ContextSource {
                        if ( $this->getLanguage()->getDir() !== $wgContLang->getDir() ) {
                                $previewedCSS = CSSJanus::transform( $previewedCSS, true, false );
                        }
-                       $otherTags[] = Html::inlineStyle( $previewedCSS ) . "\n";
+                       $otherTags[] = Html::inlineStyle( $previewedCSS );
                } else {
                        // Load the user styles normally
                        $moduleStyles[] = 'user';
@@ -3725,7 +3726,7 @@ class OutputPage extends ContextSource {
                        ResourceLoaderModule::TYPE_STYLES
                );
                // Add normal styles added through addStyle()/addInlineStyle() here
-               $links[] = implode( "\n", $this->buildCssLinksArray() ) . $this->mInlineStyles;
+               $links[] = implode( '', $this->buildCssLinksArray() ) . $this->mInlineStyles;
                // Add marker tag to mark the place where the client-side
                // loader should inject dynamic styles
                // We use a <meta> tag with a made-up name for this because that's valid HTML