From 1b9aef43c94a79ca58f488bbfee8c40ab5b5b5b0 Mon Sep 17 00:00:00 2001 From: Jeija Date: Fri, 19 Feb 2016 21:14:38 +0100 Subject: Ignore spaces in secure.trusted_mods setting --- src/script/lua_api/l_util.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/script') diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index c1e883a98..c04f09f90 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -388,6 +388,8 @@ int ModApiUtil::l_request_insecure_environment(lua_State *L) // Check secure.trusted_mods const char *mod_name = lua_tostring(L, -1); std::string trusted_mods = g_settings->get("secure.trusted_mods"); + trusted_mods.erase(std::remove(trusted_mods.begin(), + trusted_mods.end(), ' '), trusted_mods.end()); std::vector mod_list = str_split(trusted_mods, ','); if (std::find(mod_list.begin(), mod_list.end(), mod_name) == mod_list.end()) { -- cgit v1.2.3