Skip to content

Commit 0083ddc

Browse files
authored
Merge pull request #280 from nextcloud/fix/wrong-calendar-name-check
fix: checked the wrong calendar name
2 parents 5b6b601 + 42c3572 commit 0083ddc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/Service/GoogleCalendarAPIService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ public function importCalendar(string $userId, string $calId, string $calName, ?
176176

177177
$newCalName = trim($calName) . ' (' . $this->l10n->t('Google Calendar import') . ')';
178178
$params['{DAV:}displayname'] = $newCalName;
179+
$newCalUri = urlencode($newCalName);
179180

180-
$ncCalId = $this->calendarExists($userId, $newCalName);
181+
$ncCalId = $this->calendarExists($userId, $newCalUri);
181182
$calendarIsNew = is_null($ncCalId);
182183
if (is_null($ncCalId)) {
183-
$ncCalId = $this->caldavBackend->createCalendar('principals/users/' . $userId, urlencode($newCalName), $params);
184+
$ncCalId = $this->caldavBackend->createCalendar('principals/users/' . $userId, $newCalUri, $params);
184185
}
185186

186187
// get color list

0 commit comments

Comments
 (0)