X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupSpam.php;h=60f3884419cb14f7803a15e0c6a6b5af4d1533fe;hb=d42d1dbabd7dc81b454cfad8bbbe787cdd3cdf9f;hp=e1ea247377a7ddfbb1ff8b8e234c5206020d908a;hpb=36d9784b156ea4d906b73c8ae30f8ae2513e9a86;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php index e1ea247377..60f3884419 100644 --- a/maintenance/cleanupSpam.php +++ b/maintenance/cleanupSpam.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use MediaWiki\Revision\RevisionRecord; + require_once __DIR__ . '/Maintenance.php'; /** @@ -67,9 +69,9 @@ class CleanupSpam extends Maintenance { // Clean up spam on all wikis $this->output( "Finding spam on " . count( $wgLocalDatabases ) . " wikis\n" ); $found = false; - foreach ( $wgLocalDatabases as $wikiID ) { + foreach ( $wgLocalDatabases as $wikiId ) { /** @var Database $dbr */ - $dbr = $this->getDB( DB_REPLICA, [], $wikiID ); + $dbr = $this->getDB( DB_REPLICA, [], $wikiId ); foreach ( $protConds as $conds ) { $count = $dbr->selectField( @@ -82,9 +84,9 @@ class CleanupSpam extends Maintenance { $found = true; $cmd = wfShellWikiCmd( "$IP/maintenance/cleanupSpam.php", - [ '--wiki', $wikiID, $spec ] + [ '--wiki', $wikiId, $spec ] ); - passthru( "$cmd | sed 's/^/$wikiID: /'" ); + passthru( "$cmd | sed 's/^/$wikiId: /'" ); } } } @@ -136,8 +138,8 @@ class CleanupSpam extends Maintenance { $rev = Revision::newFromTitle( $title ); $currentRevId = $rev->getId(); - while ( $rev && ( $rev->isDeleted( Revision::DELETED_TEXT ) - || LinkFilter::matchEntry( $rev->getContent( Revision::RAW ), $domain, $protocol ) ) + while ( $rev && ( $rev->isDeleted( RevisionRecord::DELETED_TEXT ) + || LinkFilter::matchEntry( $rev->getContent( RevisionRecord::RAW ), $domain, $protocol ) ) ) { $rev = $rev->getPrevious(); } @@ -152,7 +154,7 @@ class CleanupSpam extends Maintenance { $page = WikiPage::factory( $title ); if ( $rev ) { // Revert to this revision - $content = $rev->getContent( Revision::RAW ); + $content = $rev->getContent( RevisionRecord::RAW ); $this->output( "reverting\n" ); $page->doEditContent(