Merge pull request #10902 from nextcloud/cast-timestamp-13

[13] cast timestamps older than unix epoch to 0
This commit is contained in:
Morris Jobke 2018-08-31 09:09:12 +02:00 committed by GitHub
commit 2f024dcd02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}