Skip to content

Commit

Permalink
Ignore spaces in secure.trusted_mods setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeija authored and ShadowNinja committed Feb 19, 2016
1 parent 5f4ed94 commit 1b9aef4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/script/lua_api/l_util.cpp
Expand Up @@ -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()) {
Expand Down

0 comments on commit 1b9aef4

Please sign in to comment.