Merge "Remove unused 'XMPGetInfo' and 'XMPGetResults' hooks"
[lhc/web/wiklou.git] / includes / specials / SpecialRandomInCategory.php
index f9e03ab..b5c9e19 100644 (file)
@@ -68,6 +68,8 @@ class SpecialRandomInCategory extends FormSpecialPage {
        }
 
        protected function getFormFields() {
+               $this->addHelpLink( 'Help:RandomInCategory' );
+
                $form = array(
                        'category' => array(
                                'type' => 'text',
@@ -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;
                        }