Index: trunk/phase3/includes/SpecialRandompage.php |
— | — | @@ -16,7 +16,17 @@ |
17 | 17 | global $wgOut, $wgContLang; |
18 | 18 | |
19 | 19 | $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 | + |
21 | 31 | $rnd->setRedirect( false ); |
22 | 32 | |
23 | 33 | $title = $rnd->getRandomTitle(); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -99,6 +99,8 @@ |
100 | 100 | policies. This can be done only by users with the 'editrobots' permission |
101 | 101 | * Use $wgJobClasses to determine the correct Job to instantiate for a particular |
102 | 102 | 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. |
103 | 105 | |
104 | 106 | == Bugfixes since 1.10 == |
105 | 107 | |