Merge "Add missing return value"
[lhc/web/wiklou.git] / includes / specials / SpecialRandompage.php
index dc4c1cd..c94d2b3 100644 (file)
@@ -64,8 +64,10 @@ class RandomPage extends SpecialPage {
 
                if ( is_null( $title ) ) {
                        $this->setHeaders();
+                       // Message: randompage-nopages, randomredirect-nopages
                        $this->getOutput()->addWikiMsg( strtolower( $this->getName() ) . '-nopages',
                                $this->getNsList(), count( $this->namespaces ) );
+
                        return;
                }
 
@@ -90,6 +92,7 @@ class RandomPage extends SpecialPage {
                                $nsNames[] = $wgContLang->getNsText( $n );
                        }
                }
+
                return $wgContLang->commaList( $nsNames );
        }
 
@@ -100,10 +103,14 @@ class RandomPage extends SpecialPage {
        public function getRandomTitle() {
                $randstr = wfRandom();
                $title = null;
-               if ( !wfRunHooks( 'SpecialRandomGetRandomTitle', array( &$randstr, &$this->isRedir, &$this->namespaces,
-                       &$this->extra, &$title ) ) ) {
+
+               if ( !wfRunHooks(
+                       'SpecialRandomGetRandomTitle',
+                       array( &$randstr, &$this->isRedir, &$this->namespaces, &$this->extra, &$title )
+               ) ) {
                        return $title;
                }
+
                $row = $this->selectRandomPageFromDB( $randstr );
 
                /* If we picked a value that was higher than any in
@@ -119,9 +126,9 @@ class RandomPage extends SpecialPage {
 
                if ( $row ) {
                        return Title::makeTitleSafe( $row->page_namespace, $row->page_title );
-               } else {
-                       return null;
                }
+
+               return null;
        }
 
        protected function getQueryInfo( $randstr ) {