Use the Doctrine to convert date string to DateTime object.

This commit is contained in:
Andreas Fischer 2013-11-26 12:21:31 +01:00
parent a330b2ef9b
commit 3bbaba1eca
1 changed files with 2 additions and 1 deletions

View File

@ -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;