Skip to content

Commit

Permalink
fix(carddav): limit vcard size
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
  • Loading branch information
SebastianKrupinski authored and AndyScherzinger committed Jul 10, 2024
1 parent 8f4e58b commit 8ecfbc7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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->getAppValue(Application::APP_ID, 'card_size_limit', '5242880');
$cardSizeLimit = (int) $this->config->getValue(Application::APP_ID, 'card_size_limit', '5242880');

Check failure on line 32 in apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UndefinedInterfaceMethod

apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php:32:41: UndefinedInterfaceMethod: Method OCP\IAppConfig::getValue does not exist (see https://psalm.dev/181)

Check failure

Code scanning / Psalm

UndefinedInterfaceMethod Error

Method OCP\IAppConfig::getValue does not exist
if ((int) $request->getRawServerValue('CONTENT_LENGTH') > $cardSizeLimit) {
throw new Forbidden("VCard object exceeds $cardSizeLimit bytes");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testPutSizeLessThenLimit(): void {

// construct method responses
$this->config
->method('getAppValue')
->method('getValue')
->with('dav', 'card_size_limit', '5242880')
->willReturn('5242880');
$this->request
Expand Down

0 comments on commit 8ecfbc7

Please sign in to comment.