diff options
author | SebastianKrupinski <krupinskis05@gmail.com> | 2024-05-01 19:51:45 -0400 |
---|---|---|
committer | SebastianKrupinski <krupinskis05@gmail.com> | 2024-05-01 19:51:45 -0400 |
commit | d25039ec1ad8560d6948cb3650e0f92ab4d17e15 (patch) | |
tree | 91cc11b0883928605babfed0274cc63f38c040a5 /apps | |
parent | f44b73e2db6d82ceb7ef9e075fce77d8e5555b0f (diff) | |
download | nextcloud-server-d25039ec1ad8560d6948cb3650e0f92ab4d17e15.tar.gz nextcloud-server-d25039ec1ad8560d6948cb3650e0f92ab4d17e15.zip |
fix(caldav): Test if user object is not null and trim senderName
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 472f745fefe..d27dcf55206 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -206,13 +206,16 @@ class IMipPlugin extends SabreIMipPlugin { // Due to a bug in sabre, the senderName property for an iTIP message can actually also be a VObject Property // If the iTIP message senderName is null or empty use the user session name as the senderName if (($iTipMessage->senderName instanceof Parameter) && !empty(trim($iTipMessage->senderName->getValue()))) { - $senderName = $iTipMessage->senderName->getValue(); + $senderName = trim($iTipMessage->senderName->getValue()); } elseif (is_string($iTipMessage->senderName) && !empty(trim($iTipMessage->senderName))) { - $senderName = $iTipMessage->senderName; + $senderName = trim($iTipMessage->senderName); + } + elseif ($this->userSession->getUser() !== null) { + $senderName = trim($this->userSession->getUser()->getDisplayName()); } else { - $senderName = $this->userSession->getUser()->getDisplayName(); + $senderName = ''; } $sender = substr($iTipMessage->sender, 7); |