r65054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65053‎ | r65054 | r65055 >
Date:11:54, 15 April 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Special:Random now carries over query string parameters
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRandompage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRandompage.php
@@ -33,7 +33,7 @@
3434 }
3535
3636 public function execute( $par ) {
37 - global $wgOut, $wgContLang;
 37+ global $wgOut, $wgContLang, $wgRequest;
3838
3939 if ($par) {
4040 $this->setNamespace( $wgContLang->getNsIndex( $par ) );
@@ -48,7 +48,9 @@
4949 return;
5050 }
5151
52 - $query = $this->isRedirect() ? 'redirect=no' : '';
 52+ $redirectParam = $this->isRedirect() ? array( 'redirect' => 'no' ) : array();
 53+ $query = array_merge( $wgRequest->getValues(), $redirectParam );
 54+ unset( $query['title'] );
5355 $wgOut->redirect( $title->getFullUrl( $query ) );
5456 }
5557
Index: trunk/phase3/RELEASE-NOTES
@@ -46,6 +46,7 @@
4747 * (bug 22474) {{urlencode:}} now takes an optional second paramter for type of
4848 escaping.
4949 * Special:Listfiles now supports a username parameter
 50+* Special:Random carries over query string parameters
5051
5152 === Bug fixes in 1.17 ===
5253 * (bug 17560) Half-broken deletion moved image files to deletion archive

Follow-up revisions

RevisionCommit summaryAuthorDate
r650561.16wmf4: MFT r65054catrope11:55, 15 April 2010

Comments

#Comment by Simetrical (talk | contribs)   22:38, 25 April 2010

I'm curious what the point of this is.

#Comment by Catrope (talk | contribs)   22:41, 25 April 2010

It's to make Special:Random?useskin=foo work. Tomasz told some mobile company to simply append ?useskin=monobook (or Vector, not sure) to all their URLs to get a consistent skin on all wikis, but this "breaks" for Special:Random because the useskin parameter isn't carried over to the redirect target.

#Comment by Simetrical (talk | contribs)   22:54, 25 April 2010

Fascinating.

Status & tagging log