From dc79c92cbc4ece6e3709c4954b65d5c97fd1acc5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 15 May 2022 23:16:14 +0200 Subject: 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. --- plugins/mod_admin_shell.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 35124e79..94530cf1 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -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 -- cgit v1.2.3