From e836083ad14b9602df153e11e82f85b1e5405a26 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Thu, 4 Apr 2019 09:03:48 -0700 Subject: [PATCH] Consult "shouldUseSpecialHistory" when making history page link This avoids an unnecessary redirect in mobile for AMC users. Bug: T219874 Change-Id: I049045d44f6e45ebb2c81f90aac4bb20831890df --- includes/skins/SkinMinerva.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 3af454b28..268cbc5c2 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -801,7 +801,8 @@ class SkinMinerva extends SkinTemplate { * @return string */ protected function getHistoryUrl( Title $title ) { - return SpecialPageFactory::exists( 'History' ) ? + return ExtensionRegistry::getInstance()->isLoaded( 'MobileFrontend' ) && + SpecialMobileHistory::shouldUseSpecialHistory( $title, $this->getUser() ) ? SpecialPage::getTitleFor( 'History', $title )->getLocalURL() : $title->getLocalURL( [ 'action' => 'history' ] ); }