mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Check calendar URI length before creation
Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
parent
2fd45e5fc8
commit
b044c7586b
1 changed files with 7 additions and 0 deletions
|
|
@ -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…
Reference in a new issue