From b96446f2e572e436a2c9eccd080e2287313656b0 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Tue, 28 May 2024 19:08:46 +0200 Subject: [PATCH] fix(attachments): allow null expireDate in createShare Signed-off-by: Grigorii K. Shartsev --- lib/Share/Helper/ShareAPIController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Share/Helper/ShareAPIController.php b/lib/Share/Helper/ShareAPIController.php index 8b215be2c53..782507e9c36 100644 --- a/lib/Share/Helper/ShareAPIController.php +++ b/lib/Share/Helper/ShareAPIController.php @@ -78,14 +78,14 @@ public function formatShare(IShare $share): array { * @param IShare $share * @param string $shareWith * @param int $permissions - * @param string $expireDate + * @param ?string $expireDate * @throws OCSNotFoundException */ - public function createShare(IShare $share, string $shareWith, int $permissions, string $expireDate): void { + public function createShare(IShare $share, string $shareWith, int $permissions, ?string $expireDate = null): void { $share->setSharedWith($shareWith); $share->setPermissions($permissions); - if ($expireDate !== '') { + if ($expireDate !== null && $expireDate !== '') { try { $expireDateTime = $this->parseDate($expireDate); $share->setExpirationDate($expireDateTime);