jenkins-bot has submitted this change and it was merged. Change subject: Replace Revision::getText() ......................................................................
Replace Revision::getText() Bug: T147380 Change-Id: I07c80b57fd2c8f9264dd30dd9293f0ac4dcb6071 --- M BaseBlacklist.php M cleanup.php 2 files changed, 10 insertions(+), 4 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/BaseBlacklist.php b/BaseBlacklist.php index 4b4112a..d025f93 100644 --- a/BaseBlacklist.php +++ b/BaseBlacklist.php @@ -386,7 +386,9 @@ __METHOD__ ); - return $row ? Revision::newFromRow( $row )->getText() : false; + return $row + ? ContentHandler::getContentText( Revision::newFromRow( $row )->getContent() ) + : false; } /** diff --git a/cleanup.php b/cleanup.php index ff0d951..8bc2fb2 100644 --- a/cleanup.php +++ b/cleanup.php @@ -18,7 +18,11 @@ while ( $rev ) { $matches = false; foreach ( $regexes as $regex ) { - $matches = $matches || preg_match( $regex, $rev->getText() ); + $matches = $matches + || preg_match( + $regex, + ContentHandler::getContentText( $rev->getContent() ) + ); } if ( !$matches ) { // Didn't find any spam @@ -46,7 +50,7 @@ $comment = "All revisions matched the spam blacklist ($match), blanking"; } else { // Revert to this revision - $text = $rev->getText(); + $text = ContentHandler::getContentText( $rev->getContent() ); $comment = "Cleaning up links to $match"; } $wikiPage = new WikiPage( $title ); @@ -103,7 +107,7 @@ } $revision = Revision::loadFromPageId( $dbr, $id ); if ( $revision ) { - $text = $revision->getText(); + $text = ContentHandler::getContentText( $revision->getContent() ); if ( $text ) { foreach ( $regexes as $regex ) { if ( preg_match( $regex, $text, $matches ) ) { -- To view, visit https://gerrit.wikimedia.org/r/314199 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I07c80b57fd2c8f9264dd30dd9293f0ac4dcb6071 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: master Gerrit-Owner: Reedy <re...@wikimedia.org> Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits