Skip to content

Commit 1a016f2

Browse files
authored
Merge pull request #10837 from nextcloud/dav-search-no-negative-mtime-13
[13] disallow negative mtime in dav search
2 parents 2d5d8b6 + d69234e commit 1a016f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/dav/lib/Files/FileSearchBackend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private function castValue($propertyName, $value) {
270270
return 0 + $value;
271271
case SearchPropertyDefinition::DATATYPE_DATETIME:
272272
if (is_numeric($value)) {
273-
return 0 + $value;
273+
return max(0, 0 + $value);
274274
}
275275
$date = \DateTime::createFromFormat(\DateTime::ATOM, $value);
276276
return ($date instanceof \DateTime) ? $date->getTimestamp() : 0;

0 commit comments

Comments
 (0)