From: Brion Vibber Date: Fri, 22 Jun 2007 14:25:23 +0000 (+0000) Subject: Revert r23197 -- while well-meaning, this would severely overrepresent minor content... X-Git-Tag: 1.31.0-rc.0~52453 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=73ef5a9d4ab777e97f18c02b6b414a982f2d3675;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6dd48abfa6..64b3724ba0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -99,8 +99,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN policies. This can be done only by users with the 'editrobots' permission * Use $wgJobClasses to determine the correct Job to instantiate for a particular queued task; allows extensions to introduce custom jobs -* Special:Randompage with no parameters now selects a random page from any - namespace in $wgContentNamespaces, rather than just from NS_MAIN. == Bugfixes since 1.10 == diff --git a/includes/SpecialRandompage.php b/includes/SpecialRandompage.php index de6450b886..e6c4abe829 100644 --- a/includes/SpecialRandompage.php +++ b/includes/SpecialRandompage.php @@ -16,17 +16,7 @@ function wfSpecialRandompage( $par = null ) { global $wgOut, $wgContLang; $rnd = new RandomPage(); - - if ( $par == null ) { - // Select a random content namespace to use. - global $wgContentNamespaces; - $n = array_rand( $wgContentNamespaces ); - $rnd->setNamespace( $wgContentNamespaces[$n] ); - } - else { - $rnd->setNamespace( $wgContLang->getNsIndex( $par ) ); - } - + $rnd->setNamespace( $wgContLang->getNsIndex( $par ) ); $rnd->setRedirect( false ); $title = $rnd->getRandomTitle();