Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/lib/service/email/email_templates.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ bool isValidEmail(String email) {
// strict pattern check
if (!_strictEmailRegExp.hasMatch(email)) return false;

// also reject commas
if (email.contains(',')) return false;

// checking for IPv4 or IPv6 addresses
var isInternetAddress = false;
try {
Expand Down
4 changes: 4 additions & 0 deletions app/test/service/email/email_templates_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ void main() {
// verify that we have rejected emails
expect(rejectedEmails, hasLength(215));
});

test('reject multiple addresses', () {
expect(isValidEmail('abc@example.com,efg@example.com'), false);
});
});

group('EmailAddress format', () {
Expand Down
Loading