"SELECT 'Newpages' as type,
rc_namespace AS namespace,
rc_title AS title,
- rc_cur_id AS value,
+ rc_cur_id AS cur_id,
rc_user AS user,
rc_user_text AS user_text,
rc_comment as comment,
rc_timestamp AS timestamp,
+ rc_timestamp AS value,
'{$usepatrol}' as usepatrol,
rc_patrolled AS patrolled,
rc_id AS rcid,
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 );