mirror of
https://github.com/nextcloud/server.git
synced 2026-04-26 08:38:11 -04:00
Use the Doctrine to convert date string to DateTime object.
This commit is contained in:
parent
a330b2ef9b
commit
3bbaba1eca
1 changed files with 2 additions and 1 deletions
|
|
@ -844,7 +844,8 @@ class Share {
|
|||
protected static function expireItem(array $item) {
|
||||
if (!empty($item['expiration'])) {
|
||||
$now = new \DateTime();
|
||||
$expirationDate = new \DateTime($item['expiration'], new \DateTimeZone('UTC'));
|
||||
$expirationDate = \Doctrine\DBAL\Types\Type::getType('datetime')
|
||||
->convertToPhpValue($item['expiration'], \OC_DB::getConnection()->getDatabasePlatform());
|
||||
if ($now > $expirationDate) {
|
||||
self::unshareItem($item);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue