Blacklist core data directory for wml.load() - fixes #4302

This commit is contained in:
Celtic Minstrel 2019-11-12 23:01:52 -05:00
parent f2f9bc5d80
commit ddffc1a4fd
2 changed files with 4 additions and 0 deletions

View file

@ -43,6 +43,7 @@
* New read-write keys in unit userdata: ellipse, halo, description, renamable
* New functions for working with WML: wml.merge, wml.diff, wml.patch
* wesnoth.wml_matches_filter renamed to wml.matches_filter (the old name still works)
* wml.load() will no longer load files from the core data directory
### WML engine
* Support upkeep in StandardUnitFilter
* [effect]apply_to=variation now supports heal_full

View file

@ -453,6 +453,9 @@ static int intf_wml_tostring(lua_State* L) {
static int intf_load_wml(lua_State* L)
{
std::string file = luaL_checkstring(L, 1);
if(file.empty() || file[0] != '~') {
return luaL_argerror(L, 1, "security error: only userdata WML files may be loaded from Lua");
}
bool preprocess = true;
preproc_map defines_map;
if(lua_type(L, 2) == LUA_TBOOLEAN) {