Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(caldav): Test if user object is not null and trim senderName
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed May 1, 2024
commit d25039ec1ad8560d6948cb3650e0f92ab4d17e15
9 changes: 6 additions & 3 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,16 @@ public function schedule(Message $iTipMessage) {
// 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()))) {

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of trim cannot be null, possibly null value provided
$senderName = $iTipMessage->senderName->getValue();
$senderName = trim($iTipMessage->senderName->getValue());

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of trim cannot be null, possibly null value provided
}
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());

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getDisplayName on possibly null value
}
else {
$senderName = $this->userSession->getUser()->getDisplayName();
$senderName = '';
}

$sender = substr($iTipMessage->sender, 7);
Expand Down