Browse Source

disallow negative mtime in dav search

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/10835/head
Robin Appelman 7 years ago
parent
commit
b76e6be441
  1. 2
      apps/dav/lib/Files/FileSearchBackend.php

2
apps/dav/lib/Files/FileSearchBackend.php

@ -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;

Loading…
Cancel
Save