From faa381e3edc0ff5e44e0ff78b65b683a3ffe1d70 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 15 May 2020 21:22:35 +0200 Subject: mod_storage_internal: Fix error in time limited queries on items without 'when' field, fixes #1557 --- plugins/mod_storage_internal.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua index 42b451bd..0becfc8f 100644 --- a/plugins/mod_storage_internal.lua +++ b/plugins/mod_storage_internal.lua @@ -104,12 +104,14 @@ function archive:find(username, query) end if query.start then items:filter(function (item) - return item.when >= query.start; + local when = item.when or datetime.parse(item.attr.stamp); + return when >= query.start; end); end if query["end"] then items:filter(function (item) - return item.when <= query["end"]; + local when = item.when or datetime.parse(item.attr.stamp); + return when <= query["end"]; end); end count = #items; -- cgit v1.2.3