Limit Echo mentions to 20 users

Bug: 50082
Change-Id: I7eb0f41fc9b0e3a396383a1adaecf51dc883217f
This commit is contained in:
Erik Bernhardson 2014-09-11 11:14:17 -07:00 committed by EBernhardson
parent f4ef97cb06
commit 44ec374632

View file

@ -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;
}
}