summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialRandomInCategory.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialRandomInCategory.php')
-rw-r--r--includes/specials/SpecialRandomInCategory.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/specials/SpecialRandomInCategory.php b/includes/specials/SpecialRandomInCategory.php
index 570ab3bf..b5c9e19a 100644
--- a/includes/specials/SpecialRandomInCategory.php
+++ b/includes/specials/SpecialRandomInCategory.php
@@ -68,6 +68,8 @@ class SpecialRandomInCategory extends FormSpecialPage {
}
protected function getFormFields() {
+ $this->addHelpLink( 'Help:RandomInCategory' );
+
$form = array(
'category' => array(
'type' => 'text',
@@ -117,7 +119,7 @@ class SpecialRandomInCategory extends FormSpecialPage {
return Status::newFatal( $msg );
} elseif ( !$this->category ) {
- return; // no data sent
+ return false; // no data sent
}
$title = $this->getRandomTitle();
@@ -179,12 +181,12 @@ class SpecialRandomInCategory extends FormSpecialPage {
* @param float $rand Random number between 0 and 1
* @param int $offset Extra offset to fudge randomness
* @param bool $up True to get the result above the random number, false for below
- *
+ * @return array Query information.
+ * @throws MWException
* @note The $up parameter is supposed to counteract what would happen if there
* was a large gap in the distribution of cl_timestamp values. This way instead
* of things to the right of the gap being favoured, both sides of the gap
* are favoured.
- * @return array Query information.
*/
protected function getQueryInfo( $rand, $offset, $up ) {
$op = $up ? '>=' : '<=';
@@ -230,7 +232,7 @@ class SpecialRandomInCategory extends FormSpecialPage {
if ( !$this->minTimestamp || !$this->maxTimestamp ) {
try {
list( $this->minTimestamp, $this->maxTimestamp ) = $this->getMinAndMaxForCat( $this->category );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
// Possibly no entries in category.
return false;
}