Skip to content

Commit e2a64c7

Browse files
authored
cast timestamps older than unix epoch to 0
This change solves issues nextcloud#10870, which is caused by method castValue of class FileSearchBackend: It casts the timestamps older than the unix epoch to false., see my comment nextcloud#10835 (comment).
1 parent 8b47f45 commit e2a64c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/dav/lib/Files/FileSearchBackend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ private function castValue(SearchPropertyDefinition $property, $value) {
355355
return max(0, 0 + $value);
356356
}
357357
$date = \DateTime::createFromFormat(\DateTime::ATOM, $value);
358-
return ($date instanceof \DateTime) ? $date->getTimestamp() : 0;
358+
return ($date instanceof \DateTime && $date->getTimestamp() !== false) ? $date->getTimestamp() : 0;
359359
default:
360360
return $value;
361361
}

0 commit comments

Comments
 (0)