r95268 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95267‎ | r95268 | r95269 >
Date:22:32, 22 August 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
fix for bug 26797
Modified paths:
  • /trunk/extensions/MobileFrontend/views/information/disable.html.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/views/information/disable.html.php
@@ -1,4 +1,7 @@
22 <?php
 3+
 4+$lang = self::$code;
 5+
36 $disableHtml = <<<EOT
47 <h1>
58 {$areYouSure}
@@ -7,8 +10,8 @@
811 {$explainDisable}
912 </p>
1013 <div id='disableButtons'>
11 - <form action='http://en.wikipedia.org/w/mobileRedirect.php' method='get'>
12 - <input name='to' type='hidden' value='http://en.wikipedia.org/' />
 14+ <form action='http://{$lang}.wikipedia.org/w/mobileRedirect.php' method='get'>
 15+ <input name='to' type='hidden' value='http://{$lang}.wikipedia.org/' />
1316 <input name='expires_in_days' type='hidden' value='3650' />
1417 <button id='disableButton' type='submit'>{$disableButton}</button>
1518 </form>

Follow-up revisions

RevisionCommit summaryAuthorDate
r95269mft r95268preilly22:33, 22 August 2011
r97750fix for r95268 comment 21339preilly18:03, 21 September 2011
r97751fix for r95268 comment 21339 remove use of issetpreilly18:13, 21 September 2011

Comments

#Comment by MZMcBride (talk | contribs)   19:58, 23 August 2011
-    <form action='[http://en.wikipedia.org/w/mobileRedirect.php' http://en.wikipedia.org/w/mobileRedirect.php'] method='get'> 
+    <form action='[http://{$lang}.wikipedia.org/w/mobileRedirect.php' http://{$lang}.wikipedia.org/w/mobileRedirect.php'] method='get'> 

Can't this use a relative URL? Or at least use $wgScriptPath or whatever? Hardcoding any part of the domain or relative path name here seems unnecessary.

#Comment by MZMcBride (talk | contribs)   20:08, 23 August 2011

The mangled code review comment issue is tracked by bug 18614, for reference.

#Comment by Preilly (talk | contribs)   20:02, 23 August 2011

The mobileRedirect.php script lives on a different domain. The mobile site is on let's say en.m.wikipedia.org and that script is on the main en.wikipedia.org site.

#Comment by MaxSem (talk | contribs)   20:06, 23 August 2011

Then introduce a separate config var. After all, this extension will run on non-Wikipedia projects, too.

#Comment by Preilly (talk | contribs)   18:05, 21 September 2011

This should now be fixed in r97750.

#Comment by Preilly (talk | contribs)   18:15, 21 September 2011

Small change made in r97751 to avoid the use of isset.

#Comment by MZMcBride (talk | contribs)   20:13, 23 August 2011

Ah, okay. That makes more sense. I agree with MaxSem that you'll probably need a separate configuration variable here. It simply can't be "http://{$lang}.wikipedia.org/w/mobileRedirect.php", though. It breaks other Wikimedia wiki families, to say nothing of wikis trying to use this extension outside of Wikimedia.

Status & tagging log