http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97750

Revision: 97750
Author:   preilly
Date:     2011-09-21 18:03:41 +0000 (Wed, 21 Sep 2011)
Log Message:
-----------
fix for r95268 comment 21339

Modified Paths:
--------------
    trunk/extensions/MobileFrontend/MobileFrontend.php
    trunk/extensions/MobileFrontend/views/information/disable.html.php

Modified: trunk/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.php  2011-09-21 17:27:21 UTC 
(rev 97749)
+++ trunk/extensions/MobileFrontend/MobileFrontend.php  2011-09-21 18:03:41 UTC 
(rev 97750)
@@ -51,6 +51,14 @@
 
 $wgMobileDomain = '.m.';
 
+/**
+ * URL for script used to disable mobile site
+ * (protocol, host, optional port; path portion)
+ *
+ * e.g., http://en.wikipedia.org/w/mobileRedirect.php
+ */
+$wgMobileRedirectFormAction;
+
 $wgExtMobileFrontend = new ExtMobileFrontend();
 
 $wgHooks['BeforePageDisplay'][] = array( &$wgExtMobileFrontend, 
'beforePageDisplayHTML' );
@@ -76,7 +84,7 @@
 }
 
 class ExtMobileFrontend {
-       const VERSION = '0.5.66';
+       const VERSION = '0.5.67';
 
        /**
         * @var DOMDocument
@@ -116,6 +124,7 @@
        public static $currentURL;
        public static $displayNoticeId;
        public static $leaveFeedbackURL;
+       public static $mobileRedirectFormAction;
        
        public static $messageKeys = array( 
                'mobile-frontend-show-button',
@@ -216,7 +225,7 @@
        }
 
        public function getMsg() {
-               global $wgUser, $wgContLang, $wgRequest;
+               global $wgUser, $wgContLang, $wgRequest, $wgServer, 
$wgMobileRedirectFormAction, $wgMobileDomain;
                wfProfileIn( __METHOD__ );
                
                self::$disableImagesURL = $wgRequest->escapeAppendQuery( 
'disableImages=1' );
@@ -248,6 +257,9 @@
 
                self::$dir = $wgContLang->getDir();
                self::$code = $wgContLang->getCode();
+               
+               $nonMobileServerBaseURL = str_replace( $wgMobileDomain, '.', 
$wgServer );
+               self::$mobileRedirectFormAction = ( isset( 
$wgMobileRedirectFormAction ) ) ? $wgMobileRedirectFormAction : 
"{$nonMobileServerBaseURL}/w/mobileRedirect.php";
 
                self::$mainPageUrl = Title::newMainPage()->getLocalUrl();
                self::$randomPageUrl = $this->getRelativeURL( 
SpecialPage::getTitleFor( 'Randompage' )->getLocalUrl() );

Modified: trunk/extensions/MobileFrontend/views/information/disable.html.php
===================================================================
--- trunk/extensions/MobileFrontend/views/information/disable.html.php  
2011-09-21 17:27:21 UTC (rev 97749)
+++ trunk/extensions/MobileFrontend/views/information/disable.html.php  
2011-09-21 18:03:41 UTC (rev 97750)
@@ -1,8 +1,8 @@
 <?php
 
-$lang = self::$code;
 $currentURL = self::$currentURL;
 $currentURL = str_replace('&mobileaction=disable_mobile_site', '', 
$currentURL);
+$mobileRedirectFormAction = self::$mobileRedirectFormAction;
 
 $disableHtml = <<<EOT
  <h1>
@@ -12,7 +12,7 @@
                  {$explainDisable}
                </p>
                <div id='disableButtons'>
-               <form 
action='http://{$lang}.wikipedia.org/w/mobileRedirect.php' method='get'>
+               <form action='{$mobileRedirectFormAction}' method='get'>
                        <input name='to' type='hidden' value='{$currentURL}' />
                        <input name='expires_in_days' type='hidden' 
value='3650' />
                        <button id='disableButton' 
type='submit'>{$disableButton}</button>


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

Reply via email to