r97750 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97749‎ | r97750 | r97751 >
Date:18:03, 21 September 2011
Author:preilly
Status:resolved
Tags:
Comment:
fix for r95268 comment 21339
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/information/disable.html.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -51,6 +51,14 @@
5252
5353 $wgMobileDomain = '.m.';
5454
 55+/**
 56+ * URL for script used to disable mobile site
 57+ * (protocol, host, optional port; path portion)
 58+ *
 59+ * e.g., http://en.wikipedia.org/w/mobileRedirect.php
 60+ */
 61+$wgMobileRedirectFormAction;
 62+
5563 $wgExtMobileFrontend = new ExtMobileFrontend();
5664
5765 $wgHooks['BeforePageDisplay'][] = array( &$wgExtMobileFrontend, 'beforePageDisplayHTML' );
@@ -76,7 +84,7 @@
7785 }
7886
7987 class ExtMobileFrontend {
80 - const VERSION = '0.5.66';
 88+ const VERSION = '0.5.67';
8189
8290 /**
8391 * @var DOMDocument
@@ -116,6 +124,7 @@
117125 public static $currentURL;
118126 public static $displayNoticeId;
119127 public static $leaveFeedbackURL;
 128+ public static $mobileRedirectFormAction;
120129
121130 public static $messageKeys = array(
122131 'mobile-frontend-show-button',
@@ -216,7 +225,7 @@
217226 }
218227
219228 public function getMsg() {
220 - global $wgUser, $wgContLang, $wgRequest;
 229+ global $wgUser, $wgContLang, $wgRequest, $wgServer, $wgMobileRedirectFormAction, $wgMobileDomain;
221230 wfProfileIn( __METHOD__ );
222231
223232 self::$disableImagesURL = $wgRequest->escapeAppendQuery( 'disableImages=1' );
@@ -248,6 +257,9 @@
249258
250259 self::$dir = $wgContLang->getDir();
251260 self::$code = $wgContLang->getCode();
 261+
 262+ $nonMobileServerBaseURL = str_replace( $wgMobileDomain, '.', $wgServer );
 263+ self::$mobileRedirectFormAction = ( isset( $wgMobileRedirectFormAction ) ) ? $wgMobileRedirectFormAction : "{$nonMobileServerBaseURL}/w/mobileRedirect.php";
252264
253265 self::$mainPageUrl = Title::newMainPage()->getLocalUrl();
254266 self::$randomPageUrl = $this->getRelativeURL( SpecialPage::getTitleFor( 'Randompage' )->getLocalUrl() );
Index: trunk/extensions/MobileFrontend/views/information/disable.html.php
@@ -1,8 +1,8 @@
22 <?php
33
4 -$lang = self::$code;
54 $currentURL = self::$currentURL;
65 $currentURL = str_replace('&mobileaction=disable_mobile_site', '', $currentURL);
 6+$mobileRedirectFormAction = self::$mobileRedirectFormAction;
77
88 $disableHtml = <<<EOT
99 <h1>
@@ -12,7 +12,7 @@
1313 {$explainDisable}
1414 </p>
1515 <div id='disableButtons'>
16 - <form action='http://{$lang}.wikipedia.org/w/mobileRedirect.php' method='get'>
 16+ <form action='{$mobileRedirectFormAction}' method='get'>
1717 <input name='to' type='hidden' value='{$currentURL}' />
1818 <input name='expires_in_days' type='hidden' value='3650' />
1919 <button id='disableButton' type='submit'>{$disableButton}</button>

Sign-offs

UserFlagDate
MaxSeminspected18:13, 21 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95268fix for bug 26797preilly22:32, 22 August 2011

Status & tagging log