* (bug 3803) Fix links on Special:Wantedcategories with miser mode off
* Fix Special:BrokenRedirects on MySQL 5.0
* (bug 3807) Fix 'all' in namespaces drop-down on contribs, rc
+* Fail gracefully on invalid namespace in Special:Newpages
=== Caveats ===
global $wgRequest, $wgContLang;
list( $limit, $offset ) = wfCheckLimits();
+ $namespace = NS_MAIN;
if ( $par ) {
$bits = preg_split( '/\s*,\s*/', trim( $par ) );
$limit = intval($m[1]);
if ( preg_match( '/^offset=(\d+)$/', $bit, $m ) )
$offset = intval($m[1]);
- if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) )
- $namespace = $wgContLang->getNsIndex( $m[1] );
+ if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
+ $ns = $wgContLang->getNsIndex( $m[1] );
+ if( $ns !== false ) {
+ $namespace = $ns;
+ }
+ }
}
}
if ( ! isset( $shownavigation ) )
$shownavigation = ! $specialPage->including();
- $npp = new NewPagesPage( isset( $namespace ) ? $namespace : NS_MAIN );
+ $npp = new NewPagesPage( $namespace );
if ( ! $npp->doFeed( $wgRequest->getVal( 'feed' ) ) )
$npp->doQuery( $offset, $limit, $shownavigation );