summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2022-07-06 19:16:38 +0200
committerJoas Schilling <coding@schilljs.com>2022-08-26 13:57:43 +0200
commitb044c7586b25fbda46f4097a1a567ab06de55cdc (patch)
tree68373da48a7b8adcc20e1edb3a723684924064a1 /apps
parent2fd45e5fc8cd7b8f58d23f00022b3dd627b273b8 (diff)
downloadnextcloud-server-b044c7586b25fbda46f4097a1a567ab06de55cdc.tar.gz
nextcloud-server-b044c7586b25fbda46f4097a1a567ab06de55cdc.zip
Check calendar URI length before creation
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 42df838523d..a147d785cc7 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/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,