Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Ignore spaces in secure.trusted_mods setting
- Loading branch information
Showing
with
2 additions
and
0 deletions.
-
+2
−0
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<std::string> mod_list = str_split(trusted_mods, ','); |
|
|
if (std::find(mod_list.begin(), mod_list.end(), mod_name) == |
|
|
mod_list.end()) { |
|
|