Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/Model/ShareWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use OCP\Share\Exceptions\IllegalIDChangeException;
use OCP\Share\IAttributes;
use OCP\Share\IShare;
use Psr\Log\LoggerInterface;

/**
* Class ShareWrapper
Expand Down Expand Up @@ -404,6 +405,9 @@ public function getShare(
$share->setProviderId($this->getProviderId());
$share->setStatus($this->getStatus());
$share->setToken($this->getToken());
if ($this->getExpirationDate() !== null) {
$share->setExpirationDate($this->getExpirationDate());
}
$share->setHideDownload($this->getHideDownload());
$share->setAttributes($this->getAttributes());
$share->setNote($this->getShareNote());
Expand Down Expand Up @@ -570,6 +574,15 @@ public function importFromDatabase(array $data, string $prefix = ''): IQueryRow
->setShareTime($shareTime)
->setShareNote($this->get($prefix . 'note', $data));

try {
$expirationDate = $this->get('expiration', $data);
if ($expirationDate !== '') {
$this->setExpirationDate(new DateTime($expirationDate));
}
} catch (\Exception $e) {
Server::get(LoggerInterface::class)->warning('could not parse expiration date', ['exception' => $e]);
}

$this->importAttributesFromDatabase($this->get('attributes', $data));

// if (($password = $this->get('personal_password', $data, '')) !== '') {
Expand Down
Loading