cast timestamps older than unix epoch to 0

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Christian 2018-08-27 07:44:24 +02:00 committed by Robin Appelman
parent a4daa91b42
commit ed5224cd46
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ class FileSearchBackend implements ISearchBackend {
return max(0, 0 + $value);
}
$date = \DateTime::createFromFormat(\DateTime::ATOM, $value);
return ($date instanceof \DateTime) ? $date->getTimestamp() : 0;
return ($date instanceof \DateTime && $date->getTimestamp() !== false) ? $date->getTimestamp() : 0;
default:
return $value;
}