1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 14:09:06 +00:00

This should fix some problems on Linux/OSX, which uses absolute paths for mods. Thx Daxar.

This commit is contained in:
fgenesis 2014-06-21 18:14:01 +02:00
parent b5d32906f7
commit fceb1d1bcc

View file

@ -675,8 +675,11 @@ static void safePath(lua_State *L, const std::string& path)
{ {
if(path[0] == '/') if(path[0] == '/')
{ {
lua_pushliteral(L, "Absolute paths are not allowed"); if(!(dsq->mod.isActive() && path.substr(0, dsq->mod.getBaseModPath().length()) == dsq->mod.getBaseModPath())
lua_error(L); {
lua_pushliteral(L, "Absolute paths are not allowed");
lua_error(L);
}
} }
if(path.find("../") != std::string::npos) if(path.find("../") != std::string::npos)
{ {