jenkins-bot has submitted this change and it was merged. Change subject: Revert "Categorize pages containing blacklisted links" ......................................................................
Revert "Categorize pages containing blacklisted links" This resulted in doubling the appserver-memcached traffic across the Wikimedia cluster. This reverts commit 32b546a223417018a61ccb0e61ba0e21d1c42503. Change-Id: I1bc03c6ea088b02adde83efae2f1f2b5540f0f27 --- M SpamBlacklist.i18n.php M SpamBlacklist.php M SpamBlacklistHooks.php M SpamBlacklist_body.php 4 files changed, 4 insertions(+), 17 deletions(-) Approvals: Faidon Liambotis: Looks good to me, approved jenkins-bot: Verified diff --git a/SpamBlacklist.i18n.php b/SpamBlacklist.i18n.php index ebb0870..a35dbb0 100644 --- a/SpamBlacklist.i18n.php +++ b/SpamBlacklist.i18n.php @@ -52,7 +52,6 @@ 'spam-blacklisted-email-text' => 'Your email address is currently blacklisted from sending emails to other users.', 'spam-blacklisted-email-signup' => 'The given email address is currently blacklisted from use.', - 'spam-blacklisted-category' => 'Pages containing blacklisted links', 'spam-invalid-lines' => "The following spam blacklist {{PLURAL:$1|line is an|lines are}} invalid regular {{PLURAL:$1|expression|expressions}} and {{PLURAL:$1|needs|need}} to be corrected before saving the page:", 'spam-blacklist-desc' => 'Regex-based anti-spam tool allowing to blacklist URLs in pages and email addresses for registered users', @@ -79,7 +78,6 @@ 'spam-blacklisted-email' => 'Title of errorpage when trying to send an email with a blacklisted e-mail address', 'spam-blacklisted-email-text' => 'Text of errorpage when trying to send an e-mail with a blacklisted e-mail address', 'spam-blacklisted-email-signup' => 'Error when trying to create an account with an invalid e-mail address', - 'spam-blacklisted-category' => 'The category to place pages containing blacklisted links into', 'spam-invalid-lines' => 'Used as an error message. This message is followed by a list of bad lines. diff --git a/SpamBlacklist.php b/SpamBlacklist.php index 7cf171f..45e5237 100644 --- a/SpamBlacklist.php +++ b/SpamBlacklist.php @@ -58,9 +58,6 @@ $wgHooks['EditFilter'][] = 'SpamBlacklistHooks::validate'; $wgHooks['PageContentSaveComplete'][] = 'SpamBlacklistHooks::pageSaveContent'; -// categorize pages containing blacklisted links -$wgHooks['ParserAfterParse'][] = 'SpamBlacklistHooks::parserAfterParse'; - // email filters $wgHooks['UserCanSendEmail'][] = 'SpamBlacklistHooks::userCanSendEmail'; $wgHooks['AbortNewAccount'][] = 'SpamBlacklistHooks::abortNewAccount'; diff --git a/SpamBlacklistHooks.php b/SpamBlacklistHooks.php index 4c4da8b..54f833c 100644 --- a/SpamBlacklistHooks.php +++ b/SpamBlacklistHooks.php @@ -219,12 +219,4 @@ } return true; } - - static function parserAfterParse( $parser, $text, $stripState ) { - $links = $parser->getOutput()->getExternalLinks(); - if ( $links && BaseBlacklist::getInstance( 'spam' )->filter( array_keys( $links ), null, true ) ) { - $parser->addTrackingCategory( 'spam-blacklisted-category' ); - } - return true; - } } diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 9adeee2..15fbc72 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -92,11 +92,11 @@ wfRestoreWarnings(); if( $check ) { wfDebugLog( 'SpamBlacklist', "Match!\n" ); + global $wgRequest; + $ip = $wgRequest->getIP(); + $imploded = implode( ' ', $matches[0] ); + wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: $imploded\n" ); if( !$preventLog ) { - global $wgRequest; - $ip = $wgRequest->getIP(); - $imploded = implode( ' ', $matches[0] ); - wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: $imploded\n" ); $this->logFilterHit( $title, $imploded ); // Log it } if( $retVal === false ){ -- To view, visit https://gerrit.wikimedia.org/r/122286 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bc03c6ea088b02adde83efae2f1f2b5540f0f27 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: wmf/1.23wmf20 Gerrit-Owner: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits