mirror of
https://github.com/moparisthebest/minetest
synced 2024-12-22 23:58:48 -05:00
Ignore spaces in secure.trusted_mods setting
This commit is contained in:
parent
5f4ed94d90
commit
1b9aef43c9
@ -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<std::string> mod_list = str_split(trusted_mods, ',');
|
||||
if (std::find(mod_list.begin(), mod_list.end(), mod_name) ==
|
||||
mod_list.end()) {
|
||||
|
Loading…
Reference in New Issue
Block a user