mirror of
https://github.com/nextcloud/server.git
synced 2026-06-27 09:30:36 -04:00
Merge pull request #33784 from nextcloud/backport/33139/stable23
[stable23] Check calendar URI length before creation
This commit is contained in:
commit
067f62c647
2 changed files with 11 additions and 0 deletions
|
|
@ -63,6 +63,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\QueryBuilder\IQueryBuilder;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\IConfig;
|
||||
|
|
@ -793,8 +794,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,
|
||||
|
|
|
|||
|
|
@ -416,6 +416,10 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
* @throws BadRequest
|
||||
*/
|
||||
public function createAddressBook($principalUri, $url, array $properties) {
|
||||
if (strlen($url) > 255) {
|
||||
throw new BadRequest('URI too long. Address book not created');
|
||||
}
|
||||
|
||||
$values = [
|
||||
'displayname' => null,
|
||||
'description' => null,
|
||||
|
|
|
|||
Loading…
Reference in a new issue