Skip to content

Commit

Permalink
cast timestamps older than unix epoch to 0
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
cviereck authored and weeman1337 committed Sep 6, 2018
1 parent 9295698 commit 9f91bee
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 @@ -355,7 +355,7 @@ private function castValue(SearchPropertyDefinition $property, $value) {
return max(0, 0 + $value);
}
$date = \DateTime::createFromFormat(\DateTime::ATOM, $value);
return ($date instanceof \DateTime) ? $date->getTimestamp() : 0;
return ($date instanceof \DateTime && $date->getTimestamp() !== false) ? $date->getTimestamp() : 0;
default:
return $value;
}
Expand Down

0 comments on commit 9f91bee

Please sign in to comment.