mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #39083 from nextcloud/fix/check-vobject-existence
fix(CalDAV): Check if the vObject exists before attempting any operations
This commit is contained in:
commit
fc3eef9d2f
1 changed files with 22 additions and 3 deletions
|
|
@ -231,11 +231,20 @@ class Manager implements IManager {
|
|||
string $recipient,
|
||||
string $calendarData,
|
||||
): bool {
|
||||
/** @var VCalendar $vObject */
|
||||
/** @var VCalendar $vObject|null */
|
||||
$vObject = Reader::read($calendarData);
|
||||
/** @var VEvent $vEvent */
|
||||
|
||||
if ($vObject === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var VEvent|null $vEvent */
|
||||
$vEvent = $vObject->{'VEVENT'};
|
||||
|
||||
if ($vEvent === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// First, we check if the correct method is passed to us
|
||||
if (strcasecmp('REPLY', $vObject->{'METHOD'}->getValue()) !== 0) {
|
||||
$this->logger->warning('Wrong method provided for processing');
|
||||
|
|
@ -306,10 +315,20 @@ class Manager implements IManager {
|
|||
string $recipient,
|
||||
string $calendarData,
|
||||
): bool {
|
||||
/** @var VCalendar $vObject|null */
|
||||
$vObject = Reader::read($calendarData);
|
||||
/** @var VEvent $vEvent */
|
||||
|
||||
if ($vObject === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var VEvent|null $vEvent */
|
||||
$vEvent = $vObject->{'VEVENT'};
|
||||
|
||||
if ($vEvent === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// First, we check if the correct method is passed to us
|
||||
if (strcasecmp('CANCEL', $vObject->{'METHOD'}->getValue()) !== 0) {
|
||||
$this->logger->warning('Wrong method provided for processing');
|
||||
|
|
|
|||
Loading…
Reference in a new issue