diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-06 14:39:32 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-06 17:16:10 +0200 |
commit | 5fc715a9e2d2284751b46a928ab402ec28c7ca08 (patch) | |
tree | 84fe68ce559ed677dcf5d66afc6aebaf6d253a84 /apps/dav/lib/CalDAV | |
parent | 0a72756d96cb1d85b6c0fd26189c341b75ec4f0d (diff) | |
download | nextcloud-server-5fc715a9e2d2284751b46a928ab402ec28c7ca08.tar.gz nextcloud-server-5fc715a9e2d2284751b46a928ab402ec28c7ca08.zip |
fix: Adjust unit tests and protect against XSS
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r-- | apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php index e076b2cd1e2..6fa94eebc91 100644 --- a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php +++ b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php @@ -15,7 +15,9 @@ use OCA\DAV\Connector\Sabre\CachingTree; use OCA\DAV\Connector\Sabre\DavAclPlugin; use OCA\DAV\Events\SabrePluginAuthInitEvent; use OCA\DAV\RootCollection; +use OCA\Theming\ThemingDefaults; use OCP\EventDispatcher\IEventDispatcher; +use OCP\IConfig; use Psr\Log\LoggerInterface; use Sabre\VObject\ITip\Message; @@ -28,9 +30,8 @@ class InvitationResponseServer { */ public function __construct(bool $public = true) { $baseUri = \OC::$WEBROOT . '/remote.php/dav/'; - $logger = \OC::$server->get(LoggerInterface::class); - /** @var IEventDispatcher $dispatcher */ - $dispatcher = \OC::$server->query(IEventDispatcher::class); + $logger = \OCP\Server::get(LoggerInterface::class); + $dispatcher = \OCP\Server::get(IEventDispatcher::class); $root = new RootCollection(); $this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root)); @@ -42,7 +43,10 @@ class InvitationResponseServer { $this->server->httpRequest->setUrl($baseUri); $this->server->setBaseUri($baseUri); - $this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig())); + $this->server->addPlugin(new BlockLegacyClientPlugin( + \OCP\Server::get(IConfig::class), + \OCP\Server::get(ThemingDefaults::class), + )); $this->server->addPlugin(new AnonymousOptionsPlugin()); // allow custom principal uri option |