* Rewrote ObjectCache.php to conform to the modern coding style, and to be less convo...
[lhc/web/wiklou.git] / maintenance / cleanupSpam.php
index 15dd7f7..8561281 100644 (file)
@@ -45,7 +45,7 @@ class CleanupSpam extends Maintenance {
                if ( !$like ) {
                        $this->error( "Not a valid hostname specification: $spec", true );
                }
-       
+
                if ( $this->hasOption( 'all' ) ) {
                        // Clean up spam on all wikis
                        $this->output( "Finding spam on " . count( $wgLocalDatabases ) . " wikis\n" );
@@ -88,12 +88,12 @@ class CleanupSpam extends Maintenance {
                        $this->error( "Internal error: no page for ID $id" );
                        return;
                }
-       
+
                $this->output( $title->getPrefixedDBkey() . " ..." );
                $rev = Revision::newFromTitle( $title );
                $revId = $rev->getId();
                $currentRevId = $revId;
-       
+
                while ( $rev && LinkFilter::matchEntry( $rev->getText() , $domain ) ) {
                        # Revision::getPrevious can't be used in this way before MW 1.6 (Revision.php 1.26)
                        # $rev = $rev->getPrevious();
@@ -123,10 +123,9 @@ class CleanupSpam extends Maintenance {
                                $article->doEdit( $rev->getText(), wfMsg( 'spam_reverting', $domain ), EDIT_UPDATE );
                        }
                        $dbw->commit();
-                       wfDoUpdates();
                }
        }
 }
 
 $maintClass = "CleanupSpam";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );