diff options
author | Anna Larch <anna@nextcloud.com> | 2022-05-16 15:04:59 +0300 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2022-05-18 12:26:56 +0300 |
commit | afb3d38cb83936a85715a1ca76a4fbbcc723ae74 (patch) | |
tree | e58df43f0ed5376e91d62735afd75c73d5125a50 /apps/dav/lib | |
parent | b04eea56632b5cf7a11bb998d2ac9fab67cfdc88 (diff) |
Add email validationbackport/32428/stable24
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav/lib')
-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 456b9f8b42d..85590d506cf 100644 --- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php +++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php @@ -272,7 +272,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] = []; + } } } @@ -344,8 +347,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; } /** |