From e2a64c713ff103cdeb4c8320de792487218d49ca Mon Sep 17 00:00:00 2001 From: Christian <16852529+cviereck@users.noreply.github.com> Date: Mon, 27 Aug 2018 07:44:24 +0200 Subject: cast timestamps older than unix epoch to 0 This change solves issues #10870, which is caused by method castValue of class FileSearchBackend: It casts the timestamps older than the unix epoch to false., see my comment https://github.com/nextcloud/server/pull/10835#discussion_r212806153. --- apps/dav/lib/Files/FileSearchBackend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index cac6e8ac52b..0157ae038cb 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -355,7 +355,7 @@ class FileSearchBackend implements ISearchBackend { 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; } -- cgit v1.2.3