Merge "Use array_merge() for OutputPage::$mLanguageLinks, not +"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 30 Jul 2018 03:14:34 +0000 (03:14 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 30 Jul 2018 03:14:34 +0000 (03:14 +0000)
1  2 
includes/OutputPage.php

diff --combined includes/OutputPage.php
@@@ -403,6 -403,18 +403,6 @@@ class OutputPage extends ContextSource 
                return $this->mLinktags;
        }
  
 -      /**
 -       * Add a new \<link\> with "rel" attribute set to "meta"
 -       *
 -       * @param array $linkarr Associative array mapping attribute names to their
 -       *                 values, both keys and values will be escaped, and the
 -       *                 "rel" attribute will be automatically added
 -       */
 -      function addMetadataLink( array $linkarr ) {
 -              $linkarr['rel'] = $this->getMetadataAttribute();
 -              $this->addLink( $linkarr );
 -      }
 -
        /**
         * Set the URL to be used for the <link rel=canonical>. This should be used
         * in preference to addLink(), to avoid duplicate link tags.
                return $this->mCanonicalUrl;
        }
  
 -      /**
 -       * Get the value of the "rel" attribute for metadata links
 -       *
 -       * @return string
 -       */
 -      public function getMetadataAttribute() {
 -              # note: buggy CC software only reads first "meta" link
 -              static $haveMeta = false;
 -              if ( $haveMeta ) {
 -                      return 'alternate meta';
 -              } else {
 -                      $haveMeta = true;
 -                      return 'meta';
 -              }
 -      }
 -
        /**
         * Add raw HTML to the list of scripts (including \<script\> tag, etc.)
         * Internal use only. Use OutputPage::addModules() or OutputPage::addJsConfigVars()
         *                               (e.g. 'fr:Test page')
         */
        public function addLanguageLinks( array $newLinkArray ) {
-               $this->mLanguageLinks += $newLinkArray;
+               $this->mLanguageLinks = array_merge( $this->mLanguageLinks, $newLinkArray );
        }
  
        /**
         * @param ParserOutput $parserOutput
         */
        public function addParserOutputMetadata( $parserOutput ) {
-               $this->mLanguageLinks += $parserOutput->getLanguageLinks();
+               $this->mLanguageLinks =
+                       array_merge( $this->mLanguageLinks, $parserOutput->getLanguageLinks() );
                $this->addCategoryLinks( $parserOutput->getCategories() );
                $this->setIndicators( $parserOutput->getIndicators() );
                $this->mNewSectionLink = $parserOutput->getNewSection();