r23220 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23219‎ | r23220 | r23221 >
Date:14:25, 22 June 2007
Author:brion
Status:old
Tags:
Comment:
Revert r23197 -- while well-meaning, this would severely overrepresent minor content namespaces by selecting the namespaces with equal probability.
A better solution would be to modify the RandomPage class to allow passing pages of multiple namespaces, and giving it the complete list of content namespaces; then the selection would be properly proportional.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialRandompage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialRandompage.php
@@ -16,17 +16,7 @@
1717 global $wgOut, $wgContLang;
1818
1919 $rnd = new RandomPage();
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 -
 20+ $rnd->setNamespace( $wgContLang->getNsIndex( $par ) );
3121 $rnd->setRedirect( false );
3222
3323 $title = $rnd->getRandomTitle();
Index: trunk/phase3/RELEASE-NOTES
@@ -99,8 +99,6 @@
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.
105103
106104 == Bugfixes since 1.10 ==
107105

Follow-up revisions

RevisionCommit summaryAuthorDate
r23407Merged revisions 23203-23405 via svnmerge from...david23:00, 25 June 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23197Special:Randompage with no parameters now selects a random page from any name...amidaniel06:23, 22 June 2007

Status & tagging log