aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-05-15 23:16:14 +0200
committerKim Alvefur <zash@zash.se>2022-05-15 23:16:14 +0200
commitdc79c92cbc4ece6e3709c4954b65d5c97fd1acc5 (patch)
tree5aef25974a0f3d2fc261bcc246f8f746312646e2 /plugins
parent6a9efa5a52289b58401faf6e3deb7a2272dd323a (diff)
downloadprosody-dc79c92cbc4ece6e3709c4954b65d5c97fd1acc5.tar.gz
prosody-dc79c92cbc4ece6e3709c4954b65d5c97fd1acc5.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_shell.lua4
1 files changed, 2 insertions, 2 deletions
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