Skip to content

Commit

Permalink
Merge pull request #10835 from nextcloud/dav-search-no-negative-mtime
Browse files Browse the repository at this point in the history
disallow negative mtime in dav search
  • Loading branch information
MorrisJobke authored Aug 24, 2018
2 parents b1410df + b76e6be commit 29f215a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/dav/lib/Files/FileSearchBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private function castValue(SearchPropertyDefinition $property, $value) {
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;
Expand Down

0 comments on commit 29f215a

Please sign in to comment.