Fixes: incomplete record data in expired bans

catch legacy records with null expires field and update to reflect permanent ban being revoked
master
shivajiva101 2021-12-09 00:12:11 +00:00 committed by GitHub
parent 381bba309a
commit fc1df33e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -941,6 +941,7 @@ local function update_ban_record(id, source, reason, name)
reason = escape_string(reason)
local ts = os.time()
local row = bans[id] -- use cached data
row.expires = row.expires or 0 -- catch legacy
local stmt = ([[
INSERT INTO expired VALUES (%i,'%s','%s',%i,'%s',%i,'%s','%s',%i,'%s');
DELETE FROM active WHERE id = %i;