MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/118683
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
(cherry picked from commit 136c6ed6a10f309108b47a7179b4dae33bf11fc1)
---
M includes/MobileContext.php
M includes/MobileFrontend.hooks.php
2 files changed, 11 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/83/118683/1
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index b65140d..4687694 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();
@@ -614,13 +612,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 3e7f2a0..18734af 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/118683
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia858d9b4829097142726da95c0d69496d4be22e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.23wmf17
Gerrit-Owner: MaxSem <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits