summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-08-24 16:20:07 +0200
committerRobin Appelman <robin@icewind.nl>2018-08-24 16:25:35 +0200
commitd69234e3390b6ca0c4d5b2fb47661044a312ecfd (patch)
tree5b1afa33d09e1925f57513dbfafcbdc429b5e36b /apps/dav/lib
parentff8626f46ec53f98c6e19c782cb225aa46c61099 (diff)
downloadnextcloud-server-d69234e3390b6ca0c4d5b2fb47661044a312ecfd.tar.gz
nextcloud-server-d69234e3390b6ca0c4d5b2fb47661044a312ecfd.zip
disallow negative mtime in dav search
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Files/FileSearchBackend.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php
index 9616d21b887..17a4c2b1394 100644
--- a/apps/dav/lib/Files/FileSearchBackend.php
+++ b/apps/dav/lib/Files/FileSearchBackend.php
@@ -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;