Software /
code /
prosody
Changeset
12505:604bb5b8362d 0.12
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 15 May 2022 23:16:14 +0200 |
parents | 12500:88e1b94105ae |
children | 12506:d04f6f014636 12507:e242a6e74424 |
files | plugins/mod_admin_shell.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua Mon May 09 22:39:05 2022 +0200 +++ b/plugins/mod_admin_shell.lua Sun May 15 23:16:14 2022 +0200 @@ -49,12 +49,12 @@ 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