mod_storage_internal: Fix error in time limited queries on items without 'when' field, fixes #1557

This commit is contained in:
Kim Alvefur 2020-05-15 21:22:35 +02:00
parent 5e6a56e92f
commit f5d112f832

View file

@ -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;