Prevent creation of reserved address book name

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/19795/head
Christoph Wurst 5 years ago
parent ec245d5fec
commit 827c0980d8
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
  1. 11
      apps/dav/lib/CardDAV/UserAddressBooks.php

@ -28,9 +28,12 @@ declare(strict_types=1);
namespace OCA\DAV\CardDAV;
use OCA\DAV\AppInfo\PluginManager;
use OCA\DAV\CardDAV\Integration\ExternalAddressBook;
use OCP\IConfig;
use OCP\IL10N;
use Sabre\CardDAV\Backend;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\MkCol;
class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
@ -78,6 +81,14 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
}
public function createExtendedCollection($name, MkCol $mkCol) {
if (ExternalAddressBook::doesViolateReservedName($name)) {
throw new MethodNotAllowed('The resource you tried to create has a reserved name');
}
parent::createExtendedCollection($name, $mkCol);
}
/**
* Returns a list of ACE's for this node.
*

Loading…
Cancel
Save