Skip to content

Commit

Permalink
fixup! fix(carddav): limit vcard size
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianKrupinski committed Jul 5, 2024
1 parent 2701f10 commit 2a0a7f4
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->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");
}
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('getValue')
->method('getAppValue')
->with('dav', 'card_size_limit', '5242880')
->willReturn('5242880');
$this->request
Expand Down

0 comments on commit 2a0a7f4

Please sign in to comment.