Use the Doctrine to convert date string to DateTime object.
This commit is contained in:
parent
a330b2ef9b
commit
3bbaba1eca
|
@ -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 New Issue