r95317 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95316‎ | r95317 | r95318 >
Date:18:08, 23 August 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
mft r95316
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/views/information/disable.html.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -65,7 +65,7 @@
6666 );
6767
6868 class ExtMobileFrontend {
69 - const VERSION = '0.5.45';
 69+ const VERSION = '0.5.46';
7070
7171 /**
7272 * @var DOMDocument
@@ -102,6 +102,7 @@
103103 public static $enableImagesURL;
104104 public static $disableMobileSiteURL;
105105 public static $viewNormalSiteURL;
 106+ public static $currentURL;
106107
107108 public $itemsToRemove = array(
108109 '#contentSub', # redirection notice
@@ -155,6 +156,7 @@
156157 self::$enableImagesURL = $wgRequest->escapeAppendQuery( 'enableImages=1' );
157158 self::$disableMobileSiteURL = $wgRequest->escapeAppendQuery( 'mobileaction=disable_mobile_site' );
158159 self::$viewNormalSiteURL = $wgRequest->escapeAppendQuery( 'mobileaction=view_normal_site' );
 160+ self::$currentURL = $wgRequest->getFullRequestURL();
159161
160162 $skin = $wgUser->getSkin();
161163 $copyright = $skin->getCopyright();
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/views/information/disable.html.php
@@ -1,6 +1,7 @@
22 <?php
33
44 $lang = self::$code;
 5+$currentURL = self::$currentURL;
56
67 $disableHtml = <<<EOT
78 <h1>
@@ -11,7 +12,7 @@
1213 </p>
1314 <div id='disableButtons'>
1415 <form action='http://{$lang}.wikipedia.org/w/mobileRedirect.php' method='get'>
15 - <input name='to' type='hidden' value='http://{$lang}.wikipedia.org/' />
 16+ <input name='to' type='hidden' value='{$currentURL}' />
1617 <input name='expires_in_days' type='hidden' value='3650' />
1718 <button id='disableButton' type='submit'>{$disableButton}</button>
1819 </form>

Follow-up revisions

RevisionCommit summaryAuthorDate
r95387Followup r95316, r95317 per CR: escape the URL before using it in HTML. It do...catrope09:38, 24 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95316fix for bug 29016 - disabling mobile view throws us to start pagepreilly18:07, 23 August 2011

Comments

#Comment by Nikerabbit (talk | contribs)   05:26, 24 August 2011

Does the url need to be escaped?

Status & tagging log