summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-02-15 12:17:57 +0100
committerGitHub <noreply@github.com>2021-02-15 12:17:57 +0100
commit5faa34abb1b30abdf1694c4756f6b46054f7abbc (patch)
tree0c81df2f81e945ca41721eb0c421d951d8c12158 /apps
parent65465b5abc680050e75cd9e7331d5add58110386 (diff)
parent507d5cf8ad79242ee309c18499f27ed5a81de59a (diff)
downloadnextcloud-server-5faa34abb1b30abdf1694c4756f6b46054f7abbc.tar.gz
nextcloud-server-5faa34abb1b30abdf1694c4756f6b46054f7abbc.zip
Merge pull request #25625 from nextcloud/enh/psalm/substr
Check substr results
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php2
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php7
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
index fbb52c45d38..38c875315bf 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
@@ -202,7 +202,7 @@ class EmailProvider extends AbstractProvider {
$organizerEMail = substr($organizer->getValue(), 7);
- if (!$this->mailer->validateMailAddress($organizerEMail)) {
+ if ($organizerEMail === false || !$this->mailer->validateMailAddress($organizerEMail)) {
return null;
}
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();