Merge "The static declaration must come after the visibility declaration"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 27 Aug 2014 13:43:34 +0000 (13:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 27 Aug 2014 13:43:34 +0000 (13:43 +0000)
RELEASE-NOTES-1.24
includes/CategoryViewer.php
includes/DefaultSettings.php
includes/MediaWiki.php
includes/OutputPage.php
includes/specials/SpecialRunJobs.php

index e7fba76..c4822d3 100644 (file)
@@ -42,8 +42,8 @@ production.
   configurations are $wgDeletedDirectory and $wgHashedUploadDirectory.
 * The deprecated $wgUseCommaCount variable has been removed.
 * $wgEnableSorbs and $wgSorbsUrl have been removed.
-* The UserCryptPassword and UserComparePassword hooks are no longer called. Any extensions
-  using them must be updated to use the Password Hashing API.
+* The UserCryptPassword and UserComparePassword hooks are no longer called.
+  Any extensions using them must be updated to use the Password Hashing API.
 * $wgCompiledFiles has been removed.
 * $wgSortSpecialPages was removed, the listing on Special:SpecialPages is
   now always sorted.
@@ -65,6 +65,9 @@ production.
   may need to adjust your default user settings to compensate for the index change.
 * $wgDeferredUpdateList is now deprecated, you should use DeferredUpdates::addUpdate()
   instead.
+* $wgCanonicalLanguageLinks has been removed. Per Google recommendations, we
+  will not send a rel=canonical pointing to a variant-neutral page, however
+  we will send rel=alternate.
 
 === New features in 1.24 ===
 * Added a new hook, "WhatLinksHereProps", to allow extensions to annotate
index ec8efae..60694c9 100644 (file)
@@ -87,12 +87,11 @@ class CategoryViewer extends ContextSource {
        function __construct( $title, IContextSource $context, $from = array(),
                $until = array(), $query = array()
        ) {
-               global $wgCategoryPagingLimit;
                $this->title = $title;
                $this->setContext( $context );
                $this->from = $from;
                $this->until = $until;
-               $this->limit = $wgCategoryPagingLimit;
+               $this->limit = $context->getConfig()->get( 'CategoryPagingLimit' );
                $this->cat = Category::newFromTitle( $title );
                $this->query = $query;
                $this->collation = Collation::singleton();
@@ -105,10 +104,10 @@ class CategoryViewer extends ContextSource {
         * @return string HTML output
         */
        public function getHTML() {
-               global $wgCategoryMagicGallery;
                wfProfileIn( __METHOD__ );
 
-               $this->showGallery = $wgCategoryMagicGallery && !$this->getOutput()->mNoGallery;
+               $this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' )
+                       && !$this->getOutput()->mNoGallery;
 
                $this->clearCategoryState();
                $this->doCategoryQuery();
index 14799c6..5fc7377 100644 (file)
@@ -2699,11 +2699,6 @@ $wgDisableLangConversion = false;
  */
 $wgDisableTitleConversion = false;
 
-/**
- * Whether to enable canonical language links in meta data.
- */
-$wgCanonicalLanguageLinks = true;
-
 /**
  * Default variant code, if false, the default will be the language code
  */
index da4af2f..0424633 100644 (file)
@@ -682,7 +682,8 @@ class MediaWiki {
 
                $query = array( 'title' => 'Special:RunJobs',
                        'tasks' => 'jobs', 'maxjobs' => $n, 'sigexpiry' => time() + 5 );
-               $query['signature'] = SpecialRunJobs::getQuerySignature( $query );
+               $query['signature'] = SpecialRunJobs::getQuerySignature(
+                       $query, $this->config->get( 'SecretKey' ) );
 
                $errno = $errstr = null;
                $info = wfParseUrl( $this->config->get( 'Server' ) );
index 8d50e41..fbd80c9 100644 (file)
@@ -3336,25 +3336,23 @@ $templates
                }
 
                # Language variants
-               if ( !$config->get( 'DisableLangConversion' ) && $config->get( 'CanonicalLanguageLinks' ) ) {
+               if ( !$config->get( 'DisableLangConversion' ) ) {
                        $lang = $this->getTitle()->getPageLanguage();
                        if ( $lang->hasVariants() ) {
-
-                               $urlvar = $lang->getURLVariant();
-
-                               if ( !$urlvar ) {
-                                       $variants = $lang->getVariants();
-                                       foreach ( $variants as $_v ) {
-                                               $tags["variant-$_v"] = Html::element( 'link', array(
-                                                       'rel' => 'alternate',
-                                                       'hreflang' => wfBCP47( $_v ),
-                                                       'href' => $this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) )
-                                               );
-                                       }
-                               } else {
-                                       $canonicalUrl = $this->getTitle()->getLocalURL();
+                               $variants = $lang->getVariants();
+                               foreach ( $variants as $_v ) {
+                                       $tags["variant-$_v"] = Html::element( 'link', array(
+                                               'rel' => 'alternate',
+                                               'hreflang' => wfBCP47( $_v ),
+                                               'href' => $this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) )
+                                       );
                                }
                        }
+                       # x-default link per https://support.google.com/webmasters/answer/189077?hl=en
+                       $tags["variant-x-default"] = Html::element( 'link', array(
+                               'rel' => 'alternate',
+                               'hreflang' => 'x-default',
+                               'href' => $this->getTitle()->getLocalURL() ) );
                }
 
                # Copyright
index 54f224a..d4a06eb 100644 (file)
@@ -61,7 +61,7 @@ class SpecialRunJobs extends UnlistedSpecialPage {
 
                $squery = $params;
                unset( $squery['signature'] );
-               $cSig = self::getQuerySignature( $squery ); // correct signature
+               $cSig = self::getQuerySignature( $squery, $this->getConfig()->get( 'SecretKey' ) ); // correct signature
                $rSig = $params['signature']; // provided signature
 
                $verified = is_string( $rSig ) && hash_equals( $cSig, $rSig );
@@ -102,12 +102,11 @@ class SpecialRunJobs extends UnlistedSpecialPage {
 
        /**
         * @param array $query
+        * @param string $secretKey
         * @return string
         */
-       public static function getQuerySignature( array $query ) {
-               global $wgSecretKey;
-
+       public static function getQuerySignature( array $query, $secretKey ) {
                ksort( $query ); // stable order
-               return hash_hmac( 'sha1', wfArrayToCgi( $query ), $wgSecretKey );
+               return hash_hmac( 'sha1', wfArrayToCgi( $query ), $secretKey );
        }
 }