From 8062e6d98009836112ec01bffa70af9f12e7e075 Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Sun, 27 Sep 2020 12:33:06 +0200 Subject: [PATCH] Remove metatable functionality from lua context --- .../LuaProgrammingLanguageInterpreter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs b/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs index ee8eb78..94a0a40 100644 --- a/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs +++ b/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs @@ -32,6 +32,9 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter LoggingFacade.Trace("Disabling Lua `import` function"); _state.DoString ("\nimport = function () end\n"); + LoggingFacade.Trace("Disabling Lua `metatable` functionality"); + _state.DoString ("\ngetmetatable = function () end\n"); + _state.DoString ("\nsetmetatable = function () end\n"); LoggingFacade.Trace("Running user Lua code"); _state.DoString(content, command);