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(); $mentionedUsers[$user->getId()] = $user->getId();
$count++; $count++;
// This is an unbounded list, put a cap on the allowable mentioned user list // If more than 20 users are being pinged this is likely a spam/attack vector
if ( $count > 100 ) { // Don't send any mention notifications.
break; if ( $count > 20 ) {
return;
} }
} }