Browse Source

Check calendar URI length before creation

Signed-off-by: Anna Larch <anna@nextcloud.com>
pull/33139/head
Anna Larch 3 years ago
committed by Joas Schilling
parent
commit
b044c7586b
No known key found for this signature in database GPG Key ID: 74434EFE0D2E2205
  1. 7
      apps/dav/lib/CalDAV/CalDavBackend.php

7
apps/dav/lib/CalDAV/CalDavBackend.php

@ -64,6 +64,7 @@ use OCA\DAV\Events\CalendarUpdatedEvent;
use OCA\DAV\Events\SubscriptionCreatedEvent;
use OCA\DAV\Events\SubscriptionDeletedEvent;
use OCA\DAV\Events\SubscriptionUpdatedEvent;
use OCP\Calendar\Exceptions\CalendarException;
use OCP\DB\Exception;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\EventDispatcher\IEventDispatcher;
@ -770,8 +771,14 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @param string $calendarUri
* @param array $properties
* @return int
*
* @throws CalendarException
*/
public function createCalendar($principalUri, $calendarUri, array $properties) {
if (strlen($calendarUri) > 255) {
throw new CalendarException('URI too long. Calendar not created');
}
$values = [
'principaluri' => $this->convertPrincipal($principalUri, true),
'uri' => $calendarUri,

Loading…
Cancel
Save