From 2a0a7f4ee52ae40101ed39490de526b1d9e12c43 Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Fri, 5 Jul 2024 12:47:20 -0400 Subject: [PATCH] fixup! fix(carddav): limit vcard size --- apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php | 2 +- .../tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php index 1cf081a757d2f..4acf4b439a9fd 100644 --- a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php +++ b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php @@ -29,7 +29,7 @@ public function initialize(Server $server): void { public function beforePut(RequestInterface $request, ResponseInterface $response): bool { // evaluate if card size exceeds defined limit - $cardSizeLimit = (int) $this->config->getValue(Application::APP_ID, 'card_size_limit', '5242880'); + $cardSizeLimit = (int) $this->config->getAppValue(Application::APP_ID, 'card_size_limit', '5242880'); if ((int) $request->getRawServerValue('CONTENT_LENGTH') > $cardSizeLimit) { throw new Forbidden("VCard object exceeds $cardSizeLimit bytes"); } diff --git a/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php b/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php index b6652f187b89e..8a6efb65f9557 100644 --- a/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php @@ -39,7 +39,7 @@ public function testPutSizeLessThenLimit(): void { // construct method responses $this->config - ->method('getValue') + ->method('getAppValue') ->with('dav', 'card_size_limit', '5242880') ->willReturn('5242880'); $this->request