From a2c0c699886a22f83b747e06790bde266b17eb5f Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 22 Aug 2025 09:09:35 -0100 Subject: [PATCH 1/2] fix: ignore empty expiration date Signed-off-by: Maxence Lange --- lib/Model/ShareWrapper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index 812979205..b31018a01 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -499,7 +499,10 @@ public function import(array $data): IDeserializable { $this->importAttributesFromDatabase($this->get('attributes', $data)); try { - $this->setExpirationDate(new DateTime($this->get('expiration', $data))); + $expirationDate = $this->get('expiration', $data); + if ($expirationDate !== '') { + $this->setExpirationDate(new DateTime($expirationDate)); + } } catch (\Exception $e) { } From a575561feb4b94e7ed3f9da2a0e6d1ec017c8283 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 22 Aug 2025 10:59:49 -0100 Subject: [PATCH 2/2] fix import Signed-off-by: Maxence Lange --- lib/Model/ShareWrapper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index b31018a01..8cba40325 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -28,6 +28,7 @@ use OCP\IURLGenerator; use OCP\IUserManager; use OCP\L10N\IFactory; +use OCP\Server; use OCP\Share\Exceptions\IllegalIDChangeException; use OCP\Share\IAttributes; use OCP\Share\IShare; @@ -451,7 +452,7 @@ private function setShareDisplay(IShare $share, IURLGenerator $urlGenerator): vo $display = $circle->getDisplayName(); if ($circle->getSource() === Member::TYPE_CIRCLE) { - $l10n = \OCP\Server::get(IFactory::class)->get('circles'); + $l10n = Server::get(IFactory::class)->get('circles'); $display = $l10n->t('%s (Team owned by %s)', [$display, $circle->getOwner()->getDisplayName()]); } else { $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')';