dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Make Special:MovePage note about redirects dependent on content model"
[lhc/web/wiklou.git]
/
maintenance
/
cleanupSpam.php
diff --git
a/maintenance/cleanupSpam.php
b/maintenance/cleanupSpam.php
index
04f278f
..
4cc52a4
100644
(file)
--- a/
maintenance/cleanupSpam.php
+++ b/
maintenance/cleanupSpam.php
@@
-21,6
+21,8
@@
* @ingroup Maintenance
*/
* @ingroup Maintenance
*/
+use MediaWiki\Storage\RevisionRecord;
+
require_once __DIR__ . '/Maintenance.php';
/**
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;
// Clean up spam on all wikis
$this->output( "Finding spam on " . count( $wgLocalDatabases ) . " wikis\n" );
$found = false;
- foreach ( $wgLocalDatabases as $wikiI
D
) {
- /** @var
$dbr Database
*/
- $dbr = $this->getDB( DB_REPLICA, [], $wikiI
D
);
+ foreach ( $wgLocalDatabases as $wikiI
d
) {
+ /** @var
Database $dbr
*/
+ $dbr = $this->getDB( DB_REPLICA, [], $wikiI
d
);
foreach ( $protConds as $conds ) {
$count = $dbr->selectField(
foreach ( $protConds as $conds ) {
$count = $dbr->selectField(
@@
-82,9
+84,9
@@
class CleanupSpam extends Maintenance {
$found = true;
$cmd = wfShellWikiCmd(
"$IP/maintenance/cleanupSpam.php",
$found = true;
$cmd = wfShellWikiCmd(
"$IP/maintenance/cleanupSpam.php",
- [ '--wiki', $wikiI
D
, $spec ]
+ [ '--wiki', $wikiI
d
, $spec ]
);
);
- passthru( "$cmd | sed 's/^/$wikiI
D
: /'" );
+ passthru( "$cmd | sed 's/^/$wikiI
d
: /'" );
}
}
}
}
}
}
@@
-97,7
+99,7
@@
class CleanupSpam extends Maintenance {
// Clean up spam on this wiki
$count = 0;
// Clean up spam on this wiki
$count = 0;
- /** @var
$dbr Database
*/
+ /** @var
Database $dbr
*/
$dbr = $this->getDB( DB_REPLICA );
foreach ( $protConds as $prot => $conds ) {
$res = $dbr->select(
$dbr = $this->getDB( DB_REPLICA );
foreach ( $protConds as $prot => $conds ) {
$res = $dbr->select(
@@
-136,8
+138,8
@@
class CleanupSpam extends Maintenance {
$rev = Revision::newFromTitle( $title );
$currentRevId = $rev->getId();
$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( Revision
Record
::DELETED_TEXT )
+ || LinkFilter::matchEntry( $rev->getContent( Revision
Record
::RAW ), $domain, $protocol ) )
) {
$rev = $rev->getPrevious();
}
) {
$rev = $rev->getPrevious();
}
@@
-152,7
+154,7
@@
class CleanupSpam extends Maintenance {
$page = WikiPage::factory( $title );
if ( $rev ) {
// Revert to this revision
$page = WikiPage::factory( $title );
if ( $rev ) {
// Revert to this revision
- $content = $rev->getContent( Revision::RAW );
+ $content = $rev->getContent( Revision
Record
::RAW );
$this->output( "reverting\n" );
$page->doEditContent(
$this->output( "reverting\n" );
$page->doEditContent(