Removing the additional protection of the system messages in maintenance/InitialiseMe...
[lhc/web/wiklou.git] / maintenance / rebuildrecentchanges.inc
index 42e8602..e077da5 100644 (file)
@@ -17,7 +17,7 @@ function rebuildRecentChangesTablePass1()
        $dbw->delete( 'recentchanges', '*' );
 
        print( "Loading from page and revision tables...\n" );
-       
+
        global $wgRCMaxAge;
        $cutoff = time() - $wgRCMaxAge;
        $dbw->insertSelect( 'recentchanges', array( 'page', 'revision' ),
@@ -37,9 +37,11 @@ function rebuildRecentChangesTablePass1()
                        'rc_last_oldid' => 0, // is this ok?
                        'rc_type'       => $dbw->conditional( 'page_is_new != 0', RC_NEW, RC_EDIT ),
                ), array(
-                       'rev_timestamp > ' . $dbw->timestamp( $cutoff ),
+                       'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $cutoff ) ),
                        'rev_page=page_id'
-               ), $fname, array( 'ORDER BY' => 'rev_timestamp', 'LIMIT' => 5000 )
+               ), $fname,
+               array(), // INSERT options
+               array( 'ORDER BY' => 'rev_timestamp', 'LIMIT' => 5000 ) // SELECT options
        );
 }
 
@@ -72,7 +74,7 @@ function rebuildRecentChangesTablePass2()
                                "AND rev_timestamp<'{$emit}' ORDER BY rev_timestamp DESC LIMIT 1";
                        $res2 = $dbw->query( $sql2 );
                        if( $row = $dbw->fetchObject( $res2 ) ) {
-                               $lastOldId = intval( $row->old_id );
+                               $lastOldId = intval( $row->rev_id );
                        } else {
                                # No previous edit
                                $lastOldId = 0;