jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Ensure checkToggleView() fires at appropriate time" -
infinite recursion again
......................................................................
Revert "Ensure checkToggleView() fires at appropriate time" - infinite
recursion again
This reverts commit 4d36aec7d8cf569660387623957a6398ad8b49d2.
Change-Id: Ia858d9b4829097142726da95c0d69496d4be22e0
---
M includes/MobileContext.php
M includes/MobileFrontend.hooks.php
2 files changed, 11 insertions(+), 9 deletions(-)
Approvals:
MaxSem: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index ad5e520..dd18351 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -274,8 +274,6 @@
return $this->mobileView;
}
wfProfileIn( __METHOD__ );
- // check if the user requested to toggle their view
- $this->checkToggleView();
$this->mobileView = $this->shouldDisplayMobileViewInternal();
if ( $this->mobileView ) {
$this->redirectMobileEnabledPages();
@@ -612,13 +610,15 @@
*/
public function getMobileUrl( $url, $forceHttps = false ) {
- $subdomainTokenReplacement = null;
- if ( wfRunHooks( 'GetMobileUrl', array(
&$subdomainTokenReplacement, $this ) ) ) {
- if ( !empty( $subdomainTokenReplacement ) ) {
- global $wgMobileUrlTemplate;
- $mobileUrlHostTemplate =
$this->parseMobileUrlTemplate( 'host' );
- $mobileToken = $this->getMobileHostToken(
$mobileUrlHostTemplate );
- $wgMobileUrlTemplate = str_replace(
$mobileToken, $subdomainTokenReplacement, $wgMobileUrlTemplate );
+ if ( $this->shouldDisplayMobileView() ) {
+ $subdomainTokenReplacement = null;
+ if ( wfRunHooks( 'GetMobileUrl', array(
&$subdomainTokenReplacement, $this ) ) ) {
+ if ( !empty( $subdomainTokenReplacement ) ) {
+ global $wgMobileUrlTemplate;
+ $mobileUrlHostTemplate =
$this->parseMobileUrlTemplate( 'host' );
+ $mobileToken =
$this->getMobileHostToken( $mobileUrlHostTemplate );
+ $wgMobileUrlTemplate = str_replace(
$mobileToken, $subdomainTokenReplacement, $wgMobileUrlTemplate );
+ }
}
}
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 5aef038..6f39918 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -44,7 +44,9 @@
global $wgMFEnableDesktopResources, $wgMFDefaultSkinClass,
$wgULSPosition,
$wgMFWap, $wgValidSkinNames,
$wgMFEnableMinervaBetaFeature;
+ // check whether or not the user has requested to toggle their
view
$mobileContext = MobileContext::singleton();
+ $mobileContext->checkToggleView();
if ( !$mobileContext->shouldDisplayMobileView()
|| $mobileContext->isBlacklistedPage()
--
To view, visit https://gerrit.wikimedia.org/r/118681
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia858d9b4829097142726da95c0d69496d4be22e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits