jenkins-bot has submitted this change and it was merged.

Change subject: Fix double wmfSetupMobileLoadScript() invocation
......................................................................


Fix double wmfSetupMobileLoadScript() invocation

Change-Id: I9338cc6d5e7bfa404ce012c47469153d8897ef9c
---
M wmf-config/mobile.php
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php
index 974c2d7..3b46405 100644
--- a/wmf-config/mobile.php
+++ b/wmf-config/mobile.php
@@ -29,8 +29,9 @@
        // Point mobile load.php requests to a special path on bits that gets 
X-Device headers
        function wmfSetupMobileLoadScript() {
                global $wgDBname, $wgLoadScript;
+               static $initialised = false;
 
-               if ( MobileContext::singleton()->shouldDisplayMobileView() ) {
+               if ( !$initialised && 
MobileContext::singleton()->shouldDisplayMobileView() ) {
                        if ( $wgDBname === 'testwiki' ) {
                                // testwiki's resources aren't loaded from 
bits, it just needs a mobile domain
                                $wgLoadScript = 
'//test.m.wikipedia.org/w/load.php';
@@ -38,6 +39,7 @@
                                $wgLoadScript = str_replace( 
'bits.wikimedia.org/', 'bits.wikimedia.org/m/', $wgLoadScript );
                        }
                }
+               $initialised = true;
        }
 
        // Enable $wgMFVaryResources only if there's a mobile site (otherwise 
we'll end up

-- 
To view, visit https://gerrit.wikimedia.org/r/71594
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9338cc6d5e7bfa404ce012c47469153d8897ef9c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to