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

disallow negative mtime in dav search
This commit is contained in:
Morris Jobke 2018-08-24 20:32:26 +02:00 committed by GitHub
commit 29f215a90d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -352,7 +352,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;