r23197 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23196‎ | r23197 | r23198 >
Date:06:23, 22 June 2007
Author:amidaniel
Status:old
Tags:
Comment:
Special:Randompage with no parameters now selects a random page from any namespace in $wgContentNamespaces, rather than just from NS_MAIN.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialRandompage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialRandompage.php
@@ -16,7 +16,17 @@
1717 global $wgOut, $wgContLang;
1818
1919 $rnd = new RandomPage();
20 - $rnd->setNamespace( $wgContLang->getNsIndex( $par ) );
 20+
 21+ if ( $par == null ) {
 22+ // Select a random content namespace to use.
 23+ global $wgContentNamespaces;
 24+ $n = array_rand( $wgContentNamespaces );
 25+ $rnd->setNamespace( $wgContentNamespaces[$n] );
 26+ }
 27+ else {
 28+ $rnd->setNamespace( $wgContLang->getNsIndex( $par ) );
 29+ }
 30+
2131 $rnd->setRedirect( false );
2232
2333 $title = $rnd->getRandomTitle();
Index: trunk/phase3/RELEASE-NOTES
@@ -99,6 +99,8 @@
100100 policies. This can be done only by users with the 'editrobots' permission
101101 * Use $wgJobClasses to determine the correct Job to instantiate for a particular
102102 queued task; allows extensions to introduce custom jobs
 103+* Special:Randompage with no parameters now selects a random page from any
 104+ namespace in $wgContentNamespaces, rather than just from NS_MAIN.
103105
104106 == Bugfixes since 1.10 ==
105107

Follow-up revisions

RevisionCommit summaryAuthorDate
r23203Merged revisions 23120-23202 via svnmerge from...david09:07, 22 June 2007
r23220Revert r23197 -- while well-meaning, this would severely overrepresent minor ...brion14:25, 22 June 2007
r23407Merged revisions 23203-23405 via svnmerge from...david23:00, 25 June 2007

Status & tagging log