* (bug 4298) Include rc_id on enhanced RC singleton diff links for patrolling
[lhc/web/wiklou.git] / includes / SpecialNewpages.php
index 678291b..b388533 100644 (file)
@@ -43,11 +43,12 @@ class NewPagesPage extends QueryPage {
                        "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,
@@ -112,6 +113,7 @@ function wfSpecialNewpages($par, $specialPage) {
        global $wgRequest, $wgContLang;
        
        list( $limit, $offset ) = wfCheckLimits();
+       $namespace = NS_MAIN;
        
        if ( $par ) {
                $bits = preg_split( '/\s*,\s*/', trim( $par ) );
@@ -125,14 +127,18 @@ function wfSpecialNewpages($par, $specialPage) {
                                $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 );