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: I03e96a1bb223360e62d47f98a505cc5b26e5aadf
---
M SpamBlacklist.php
M SpamBlacklistHooks.php
M SpamBlacklist_body.php
M i18n/en.json
M i18n/qqq.json
5 files changed, 4 insertions(+), 17 deletions(-)

Approvals:
  Faidon Liambotis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpamBlacklist.php b/SpamBlacklist.php
index 8e319bc..cd5eb5f 100644
--- a/SpamBlacklist.php
+++ b/SpamBlacklist.php
@@ -59,9 +59,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 ){
diff --git a/i18n/en.json b/i18n/en.json
index c156b21..3ba7bf0 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -9,7 +9,6 @@
     "spam-blacklisted-email": "Blacklisted email address",
     "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",
     "log-name-spamblacklist": "Spam blacklist log",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 521f949..2303ecb 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -16,7 +16,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.\n\nThis message is 
followed by a list of bad lines.\n\nParameters:\n* $1 - the number of bad 
lines",
     "spam-blacklist-desc": "{{desc|name=Spam 
Blacklist|url=http://www.mediawiki.org/wiki/Extension:SpamBlacklist}}";,
     "log-name-spamblacklist": "Name of log that appears on [[Special:Log]].",

-- 
To view, visit https://gerrit.wikimedia.org/r/122283
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03e96a1bb223360e62d47f98a505cc5b26e5aadf
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/SpamBlacklist
Gerrit-Branch: master
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

Reply via email to