* Update Chinese translations
[lhc/web/wiklou.git] / maintenance / cleanupSpam.php
index 65d6bc4..2c269b3 100644 (file)
@@ -12,7 +12,6 @@ function cleanupArticle( $id, $domain ) {
 
        print $title->getPrefixedDBkey() . " ...";
        $rev = Revision::newFromTitle( $title );
-       $reverted = false;
        $revId = $rev->getId();
        $currentRevId = $revId;
        $regex = LinkFilter::makeRegex( $domain );
@@ -32,7 +31,7 @@ function cleanupArticle( $id, $domain ) {
                // This happens e.g. when a link comes from a template rather than the page itself
                print "False match\n";
        } else {
-               $dbw =& wfGetDB( DB_MASTER );
+               $dbw = wfGetDB( DB_MASTER );
                $dbw->immediateBegin();
                if ( !$rev ) {
                        // Didn't find a non-spammy revision, blank the page
@@ -75,11 +74,11 @@ if ( !$like ) {
        exit(1);
 }
 
-$dbr =& wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_SLAVE );
 
-if ( $options['all'] ) {
+if ( isset($options['all']) ) {
        // Clean up spam on all wikis
-       $dbr =& wfGetDB( DB_SLAVE );
+       $dbr = wfGetDB( DB_SLAVE );
        print "Finding spam on " . count($wgLocalDatabases) . " wikis\n";
        $found = false;
        foreach ( $wgLocalDatabases as $db ) {
@@ -109,4 +108,4 @@ if ( $options['all'] ) {
        }
 }
 
-?>
+