From 67881de44e6728bde2911ea0b73957baf626c243 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 16 May 2016 12:46:58 -0400 Subject: [PATCH] Avoid unstubbing $wgLang in Title::getLocalURL If $query doesn't match the regex, there's no point in unstubbing $wgLang if that's what happens to be the page language. This also avoids it blowing up if $wgLang isn't usable due to MW_NO_SESSION. Bug: T135389 Change-Id: I9a6779c4cc887205215a815db3a765c35f060c42 --- includes/Title.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index 876afe620c..25fbce3f57 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1713,9 +1713,9 @@ class Title implements LinkTarget { if ( $url === false && $wgVariantArticlePath + && preg_match( '/^variant=([^&]*)$/', $query, $matches ) && $wgContLang->getCode() === $this->getPageLanguage()->getCode() && $this->getPageLanguage()->hasVariants() - && preg_match( '/^variant=([^&]*)$/', $query, $matches ) ) { $variant = urldecode( $matches[1] ); if ( $this->getPageLanguage()->hasVariant( $variant ) ) { -- 2.20.1