Consult "shouldUseSpecialHistory" when making history page link

This avoids an unnecessary redirect in mobile for AMC users.
Bug: T219874
Change-Id: I049045d44f6e45ebb2c81f90aac4bb20831890df
This commit is contained in:
jdlrobson 2019-04-04 09:03:48 -07:00 committed by Jdlrobson
parent f9ac8d40e5
commit e836083ad1

View file

@ -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' ] );
}