From: Perttu Ahola Date: Sun, 4 Dec 2011 16:26:05 +0000 (+0200) Subject: Enforce modname naming convention X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=abd106bacb1da0c3de909b1a289ed3fa21f2215d;p=zefram%2Fminetest%2Fminetest_engine.git Enforce modname naming convention --- diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index a88d6be5..c759683e 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -164,7 +164,7 @@ void check_modname_prefix(lua_State *L, std::string &name) "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")) throw LuaError(L, std::string("Name \"")+name +"\" does not follow naming conventions: " - +"\"contains unallowed characters)"); + +"\"contains unallowed characters"); } static v3f readFloatPos(lua_State *L, int index) @@ -2672,6 +2672,14 @@ bool scriptapi_loadmod(lua_State *L, const std::string &scriptpath, { ModNameStorer modnamestorer(L, modname); + if(!string_allowed(modname, "abcdefghijklmnopqrstuvwxyz" + "0123456789_")){ + errorstream<<"Error loading mod \""<