MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118681

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/81/118681/1

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: newchange
Gerrit-Change-Id: Ia858d9b4829097142726da95c0d69496d4be22e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to