diff options
author | Robin Appelman <robin@icewind.nl> | 2017-03-13 14:44:52 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-03-13 14:44:52 +0100 |
commit | 6074dc9979fbf93eb61f05bc0c5c0512ebc9e070 (patch) | |
tree | 43f600ba5a91c7d86092e0cb8d22eb325fac8168 /apps/dav/lib/Files | |
parent | 4395cf4fa77b07da9a31b85997f781dee03da21b (diff) | |
download | nextcloud-server-6074dc9979fbf93eb61f05bc0c5c0512ebc9e070.tar.gz nextcloud-server-6074dc9979fbf93eb61f05bc0c5c0512ebc9e070.zip |
fix searching and ordering on getlastmodified
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib/Files')
-rw-r--r-- | apps/dav/lib/Files/FileSearchBackend.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index afdb425e8ed..784047ad255 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -113,7 +113,7 @@ class FileSearchBackend implements ISearchBackend { // queryable properties new SearchPropertyDefinition('{DAV:}displayname', true, false, true), new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true), - new SearchPropertyDefinition('{DAV:}getlastmodifed', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), + new SearchPropertyDefinition('{DAV:}getlastmodified', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), new SearchPropertyDefinition(FilesPlugin::SIZE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER), new SearchPropertyDefinition(TagsPlugin::FAVORITE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_BOOLEAN), @@ -236,7 +236,7 @@ class FileSearchBackend implements ISearchBackend { return 'name'; case '{DAV:}getcontenttype': return 'mimetype'; - case '{DAV:}getlastmodifed': + case '{DAV:}getlastmodified': return 'mtime'; case FilesPlugin::SIZE_PROPERTYNAME: return 'size'; @@ -261,6 +261,8 @@ class FileSearchBackend implements ISearchBackend { case SearchPropertyDefinition::DATATYPE_INTEGER: case SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER: return 0 + $value; + case SearchPropertyDefinition::DATATYPE_DATETIME: + return \DateTime::createFromFormat(\DateTime::ATOM, $value)->getTimestamp(); default: return $value; } |