Make Special:Random/ get you a page in NS_MAIN. Previously it
got a page in the content namespaces. Special:Random (no /) still
returns pages from all content namespaces.
This also affects Special:RandomRootPage from the RandomRootPage
extension.
Bug: 46420
Change-Id: I9ce66b534b86eaa09236dd56dab7ac18d1ef37ec
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 ) );
}