rely only on php DateTime to parse the db datetime string

This commit is contained in:
Jörn Friedrich Dreyer 2013-12-12 19:09:21 +01:00 committed by Bjoern Schiessle
parent 1292793c4b
commit 6408125edc
1 changed files with 2 additions and 3 deletions

View File

@ -850,9 +850,8 @@ class Share {
protected static function expireItem(array $item) {
if (!empty($item['expiration'])) {
$now = new \DateTime();
$expirationDate = \Doctrine\DBAL\Types\Type::getType('datetime')
->convertToPhpValue($item['expiration'], \OC_DB::getConnection()->getDatabasePlatform());
if ($now > $expirationDate) {
$expires = new \DateTime($item['expiration']);
if ($now > $expires) {
self::unshareItem($item);
return true;
}