From: Liangent Date: Wed, 14 Aug 2013 16:04:26 +0000 (+0000) Subject: Don't use $wgVariantArticlePath for variants of non-content languages X-Git-Tag: 1.31.0-rc.0~18974^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=dd841c2a5608a42bf39ea13314dc2391d885dcc4;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/Title.php b/includes/Title.php index 7818742889..734e009e8a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1441,7 +1441,7 @@ class Title { $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 @@ class Title { if ( $url === false && $wgVariantArticlePath && + $wgContLang->getCode() === $this->getPageLanguage()->getCode() && $this->getPageLanguage()->hasVariants() && preg_match( '/^variant=([^&]*)$/', $query, $matches ) ) {