Merge pull request #10837 from nextcloud/dav-search-no-negative-mtime-13

[13] disallow negative mtime in dav search
This commit is contained in:
Roeland Jago Douma 2018-08-24 17:46:52 +02:00 committed by GitHub
commit 1a016f21e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -270,7 +270,7 @@ class FileSearchBackend implements ISearchBackend {
return 0 + $value;
case SearchPropertyDefinition::DATATYPE_DATETIME:
if (is_numeric($value)) {
return 0 + $value;
return max(0, 0 + $value);
}
$date = \DateTime::createFromFormat(\DateTime::ATOM, $value);
return ($date instanceof \DateTime) ? $date->getTimestamp() : 0;