summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialRandompage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /includes/specials/SpecialRandompage.php
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
Diffstat (limited to 'includes/specials/SpecialRandompage.php')
-rw-r--r--includes/specials/SpecialRandompage.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php
index c94d2b35..6d8f59b5 100644
--- a/includes/specials/SpecialRandompage.php
+++ b/includes/specials/SpecialRandompage.php
@@ -56,7 +56,9 @@ class RandomPage extends SpecialPage {
public function execute( $par ) {
global $wgContLang;
- if ( $par ) {
+ if ( is_string( $par ) ) {
+ // Testing for stringiness since we want to catch
+ // the empty string to mean main namespace only.
$this->setNamespace( $wgContLang->getNsIndex( $par ) );
}
@@ -80,7 +82,7 @@ class RandomPage extends SpecialPage {
/**
* Get a comma-delimited list of namespaces we don't have
* any pages in
- * @return String
+ * @return string
*/
private function getNsList() {
global $wgContLang;
@@ -98,7 +100,7 @@ class RandomPage extends SpecialPage {
/**
* Choose a random title.
- * @return Title object (or null if nothing to choose from)
+ * @return Title|null Title object (or null if nothing to choose from)
*/
public function getRandomTitle() {
$randstr = wfRandom();
@@ -144,7 +146,6 @@ class RandomPage extends SpecialPage {
), $this->extra ),
'options' => array(
'ORDER BY' => 'page_random',
- 'USE INDEX' => 'page_random',
'LIMIT' => 1,
),
'join_conds' => array()