From be0e0fc69fc43e2b62efba3157af3c091da504e3 Mon Sep 17 00:00:00 2001 From: fenn-cs Date: Wed, 20 Mar 2024 16:41:26 +0100 Subject: [PATCH] WIP : Respect empty `expiryDate` value in server Signed-off-by: fenn-cs --- apps/files_sharing/lib/Controller/ShareAPIController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 1bdcee11c45ee..2e98a9c4fe763 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -613,6 +613,13 @@ public function createShare( $share->setNode($node); + try { + $expireDate = $expireDate !== '' ? $this->parseDate($expireDate) : null; + $share->setExpirationDate($expireDate); + } catch (\Exception $e) { + throw new OCSNotFoundException($this->l->t('Invalid date, date format must be YYYY-MM-DD')); + } + try { $this->lock($share->getNode()); } catch (LockedException $e) {