Skip to content
Merged
Changes from all commits
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
21 changes: 9 additions & 12 deletions apps/dav/lib/CalDAV/CalendarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,16 @@ protected function isShared() {
* @param Component\VCalendar $vObject
* @return void
*/
private function createConfidentialObject(Component\VCalendar $vObject) {
private function createConfidentialObject(Component\VCalendar $vObject): void {
/** @var Component $vElement */
$vElement = null;
if (isset($vObject->VEVENT)) {
$vElement = $vObject->VEVENT;
}
if (isset($vObject->VJOURNAL)) {
$vElement = $vObject->VJOURNAL;
}
if (isset($vObject->VTODO)) {
$vElement = $vObject->VTODO;
}
if (!is_null($vElement)) {
$vElements = array_filter($vObject->getComponents(), static function ($vElement) {
return $vElement instanceof Component\VEvent || $vElement instanceof Component\VJournal || $vElement instanceof Component\VTodo;
});

foreach ($vElements as $vElement) {
if (empty($vElement->select('SUMMARY'))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could trim() before checking.

$vElement->add('SUMMARY', $this->l10n->t('Busy')); // This is needed to mask "Untitled Event" events
}
foreach ($vElement->children() as &$property) {
/** @var Property $property */
switch ($property->name) {
Expand Down