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) {