rely only on php DateTime to parse the db datetime string
This commit is contained in:
parent
1292793c4b
commit
6408125edc
|
@ -850,9 +850,8 @@ class Share {
|
||||||
protected static function expireItem(array $item) {
|
protected static function expireItem(array $item) {
|
||||||
if (!empty($item['expiration'])) {
|
if (!empty($item['expiration'])) {
|
||||||
$now = new \DateTime();
|
$now = new \DateTime();
|
||||||
$expirationDate = \Doctrine\DBAL\Types\Type::getType('datetime')
|
$expires = new \DateTime($item['expiration']);
|
||||||
->convertToPhpValue($item['expiration'], \OC_DB::getConnection()->getDatabasePlatform());
|
if ($now > $expires) {
|
||||||
if ($now > $expirationDate) {
|
|
||||||
self::unshareItem($item);
|
self::unshareItem($item);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue