MaxSem 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
(cherry picked from commit 136c6ed6a10f309108b47a7179b4dae33bf11fc1)
---
M includes/MobileContext.php
M includes/MobileFrontend.hooks.php
2 files changed, 11 insertions(+), 9 deletions(-)

Approvals:
  MaxSem: Verified; Looks good to me, approved



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: merged
Gerrit-Change-Id: Ia858d9b4829097142726da95c0d69496d4be22e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.23wmf17
Gerrit-Owner: MaxSem <[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

Reply via email to