From ed282479a17ce4a1cd31ce04f405fdcaffcb0b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 3 Nov 2022 20:37:47 +0100 Subject: [PATCH] Fix validation of attachment data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/AttachmentService.php | 2 +- tests/integration/features/bootstrap/AttachmentContext.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Service/AttachmentService.php b/lib/Service/AttachmentService.php index f9eb96822..b563f0bcf 100644 --- a/lib/Service/AttachmentService.php +++ b/lib/Service/AttachmentService.php @@ -194,7 +194,7 @@ class AttachmentService { * @throws BadRequestException */ public function create($cardId, $type, $data) { - $this->attachmentServiceValidator->check(compact('cardId', 'type', 'data')); + $this->attachmentServiceValidator->check(compact('cardId', 'type')); $this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); diff --git a/tests/integration/features/bootstrap/AttachmentContext.php b/tests/integration/features/bootstrap/AttachmentContext.php index 38172075e..051789aec 100644 --- a/tests/integration/features/bootstrap/AttachmentContext.php +++ b/tests/integration/features/bootstrap/AttachmentContext.php @@ -67,6 +67,7 @@ class AttachmentContext implements Context { * @Given remember the last attachment as :arg1 */ public function rememberTheLastAttachmentAs($arg1) { + $this->requestContext->theResponseShouldHaveStatusCode(200); $this->lastAttachment = $this->requestContext->getResponseBodyFromJson(); $this->rememberedAttachments[$arg1] = $this->lastAttachment; }