Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2022-07-06 20:16:38 +0300
committerJoas Schilling <coding@schilljs.com>2022-08-26 14:57:43 +0300
commitb044c7586b25fbda46f4097a1a567ab06de55cdc (patch)
tree68373da48a7b8adcc20e1edb3a723684924064a1
parent2fd45e5fc8cd7b8f58d23f00022b3dd627b273b8 (diff)
Check calendar URI length before creation
Signed-off-by: Anna Larch <anna@nextcloud.com>
-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,