jenkins-bot has submitted this change and it was merged.

Change subject: Don't use $wgVariantArticlePath for variants of non-content 
languages
......................................................................


Don't use $wgVariantArticlePath for variants of non-content languages

Currently PathRouter understands variants of $wgContLang only, and it
wouldn't be easy to extend it to variants of the given title because at
the time of preparing PathRouter for parsing, the title is unknown yet.

Bug: 52852
Bug: 52850
Change-Id: I7dcf7dc73e36945e420a66d99329c09c75b17882
---
M includes/Title.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Matmarex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Title.php b/includes/Title.php
index 7818742..734e009 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -1441,7 +1441,7 @@
                                $url = str_replace( '$1', $dbkey, 
$wgArticlePath );
                                wfRunHooks( 'GetLocalURL::Article', array( 
&$this, &$url ) );
                        } else {
-                               global $wgVariantArticlePath, $wgActionPaths;
+                               global $wgVariantArticlePath, $wgActionPaths, 
$wgContLang;
                                $url = false;
                                $matches = array();
 
@@ -1463,6 +1463,7 @@
 
                                if ( $url === false &&
                                        $wgVariantArticlePath &&
+                                       $wgContLang->getCode() === 
$this->getPageLanguage()->getCode() &&
                                        $this->getPageLanguage()->hasVariants() 
&&
                                        preg_match( '/^variant=([^&]*)$/', 
$query, $matches ) )
                                {

-- 
To view, visit https://gerrit.wikimedia.org/r/79066
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7dcf7dc73e36945e420a66d99329c09c75b17882
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Liangent <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to