Fix SQLite quotes for history date filters

This commit is contained in:
JonnyWong16 2024-05-21 10:40:00 -07:00
commit dcdf5a2992
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -1997,15 +1997,15 @@ class WebInterface(object):
if 'start_date' in kwargs: if 'start_date' in kwargs:
start_date = helpers.split_strip(kwargs.pop('start_date', '')) start_date = helpers.split_strip(kwargs.pop('start_date', ''))
if start_date: if start_date:
custom_where.append(['strftime("%Y-%m-%d", datetime(started, "unixepoch", "localtime"))', start_date]) custom_where.append(["strftime('%Y-%m-%d', datetime(started, 'unixepoch', 'localtime'))", start_date])
if 'before' in kwargs: if 'before' in kwargs:
before = helpers.split_strip(kwargs.pop('before', '')) before = helpers.split_strip(kwargs.pop('before', ''))
if before: if before:
custom_where.append(['strftime("%Y-%m-%d", datetime(started, "unixepoch", "localtime")) <', before]) custom_where.append(["strftime('%Y-%m-%d', datetime(started, 'unixepoch', 'localtime')) <", before])
if 'after' in kwargs: if 'after' in kwargs:
after = helpers.split_strip(kwargs.pop('after', '')) after = helpers.split_strip(kwargs.pop('after', ''))
if after: if after:
custom_where.append(['strftime("%Y-%m-%d", datetime(started, "unixepoch", "localtime")) >', after]) custom_where.append(["strftime('%Y-%m-%d', datetime(started, 'unixepoch', 'localtime')) >", after])
if 'reference_id' in kwargs: if 'reference_id' in kwargs:
reference_id = helpers.split_strip(kwargs.pop('reference_id', '')) reference_id = helpers.split_strip(kwargs.pop('reference_id', ''))
if reference_id: if reference_id: