Merge "SpecialTrackingCategories: Read from the extension registry"
[lhc/web/wiklou.git] / includes / specials / SpecialRandompage.php
index 24b363d..73a88b9 100644 (file)
@@ -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 ) );
                }
 
@@ -104,7 +106,7 @@ class RandomPage extends SpecialPage {
                $randstr = wfRandom();
                $title = null;
 
-               if ( !wfRunHooks(
+               if ( !Hooks::run(
                        'SpecialRandomGetRandomTitle',
                        array( &$randstr, &$this->isRedir, &$this->namespaces, &$this->extra, &$title )
                ) ) {