From 3bbaba1ecae1f5322fcc594d40d707edadc95446 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 26 Nov 2013 12:21:31 +0100 Subject: [PATCH] Use the Doctrine to convert date string to DateTime object. --- lib/public/share.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/public/share.php b/lib/public/share.php index 708adba423..86b6cfa46a 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -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;