diff options
author | Anna Larch <anna@nextcloud.com> | 2022-05-16 14:04:59 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-05-18 07:54:30 +0200 |
commit | 440f69bd69a629ade15ded9255990a53e11ebfd4 (patch) | |
tree | cb26425ef421f5be0696c1938d5580a77377f459 /apps/dav/lib/CalDAV | |
parent | ebd9efd5843303fe6150db924560c5125ebd439e (diff) | |
download | nextcloud-server-440f69bd69a629ade15ded9255990a53e11ebfd4.tar.gz nextcloud-server-440f69bd69a629ade15ded9255990a53e11ebfd4.zip |
Add email validation
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r-- | apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php index c147b47860e..d4aea6215ea 100644 --- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php +++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php @@ -260,7 +260,10 @@ class EmailProvider extends AbstractProvider { $emailAddressesOfDelegates = $delegates->getParts(); foreach ($emailAddressesOfDelegates as $addressesOfDelegate) { if (strcasecmp($addressesOfDelegate, 'mailto:') === 0) { - $emailAddresses[substr($addressesOfDelegate, 7)] = []; + $delegateEmail = substr($addressesOfDelegate, 7); + if ($delegateEmail !== false && $this->mailer->validateMailAddress($delegateEmail)) { + $emailAddresses[$delegateEmail] = []; + } } } @@ -317,8 +320,12 @@ class EmailProvider extends AbstractProvider { if (!$this->hasAttendeeMailURI($attendee)) { return null; } + $attendeeEMail = substr($attendee->getValue(), 7); + if ($attendeeEMail === false || !$this->mailer->validateMailAddress($attendeeEMail)) { + return null; + } - return substr($attendee->getValue(), 7); + return $attendeeEMail; } /** |