aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/Schedule
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-02-13 15:27:11 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2021-02-15 10:07:13 +0100
commit507d5cf8ad79242ee309c18499f27ed5a81de59a (patch)
treeb9bd53d2469056f165e146dff74cc9e0ca66e85c /apps/dav/lib/CalDAV/Schedule
parent84de7a8d6356c4222f46b7b8139a4b6ac5f1aa96 (diff)
downloadnextcloud-server-507d5cf8ad79242ee309c18499f27ed5a81de59a.tar.gz
nextcloud-server-507d5cf8ad79242ee309c18499f27ed5a81de59a.zip
Check substr results
Else this might lead to unexpeted errors. Found by psalm. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/CalDAV/Schedule')
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index bfc82c0ee90..1f9885c0064 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -178,7 +178,7 @@ class IMipPlugin extends SabreIMipPlugin {
// Strip off mailto:
$sender = substr($iTipMessage->sender, 7);
$recipient = substr($iTipMessage->recipient, 7);
- if (!$this->mailer->validateMailAddress($recipient)) {
+ if ($recipient === false || !$this->mailer->validateMailAddress($recipient)) {
// Nothing to send if the recipient doesn't have a valid email address
$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
return;
@@ -239,9 +239,12 @@ class IMipPlugin extends SabreIMipPlugin {
$message = $this->mailer->createMessage()
->setFrom([$fromEMail => $fromName])
- ->setReplyTo([$sender => $senderName])
->setTo([$recipient => $recipientName]);
+ if ($sender !== false) {
+ $message->setReplyTo([$sender => $senderName]);
+ }
+
$template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data);
$template->addHeader();