From 44ec37463206b305c89ccf6de3cab021fb6a0da8 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Thu, 11 Sep 2014 11:14:17 -0700 Subject: [PATCH] Limit Echo mentions to 20 users Bug: 50082 Change-Id: I7eb0f41fc9b0e3a396383a1adaecf51dc883217f --- includes/DiscussionParser.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index 381b3953f..cbd2f5bb4 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -174,9 +174,10 @@ abstract class EchoDiscussionParser { } $mentionedUsers[$user->getId()] = $user->getId(); $count++; - // This is an unbounded list, put a cap on the allowable mentioned user list - if ( $count > 100 ) { - break; + // If more than 20 users are being pinged this is likely a spam/attack vector + // Don't send any mention notifications. + if ( $count > 20 ) { + return; } }