diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index 812979205..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()] . ')'; @@ -499,7 +500,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) { }