mod_admin_shell: Tighten up type checks to fix #1754 (thanks clouded)

Due to the dummy statistics provider (see core.statsmanager line 250)
having a metatable that allows infinite indexing where everything is
always the same table, which end up in suf() in the concatenation line.
This commit is contained in:
Kim Alvefur 2022-05-15 23:16:14 +02:00
parent 6a9efa5a52
commit dc79c92cbc

View file

@ -49,12 +49,12 @@ local function capitalize(s)
end
local function pre(prefix, str, alt)
if (str or "") == "" then return alt or ""; end
if type(str) ~= "string" or str == "" then return alt or ""; end
return prefix .. str;
end
local function suf(str, suffix, alt)
if (str or "") == "" then return alt or ""; end
if type(str) ~= "string" or str == "" then return alt or ""; end
return str .. suffix;
end