# HG changeset patch # User Kim Alvefur # Date 1587332233 -7200 # Node ID 7e8f2e36419dc95b75fbbeefa0a13a46dc6f6851 # Parent 19c5bfc3a2416e8a815b6808b9b80755fd4524cd mod_firewall: Use util.envload instead of deprecated loadstring (thanks Martin) loadstring was deprecated in Lua 5.2 and removed from in 5.3 diff -r 19c5bfc3a241 -r 7e8f2e36419d mod_firewall/mod_firewall.lua --- a/mod_firewall/mod_firewall.lua Sun Apr 19 08:15:09 2020 +0200 +++ b/mod_firewall/mod_firewall.lua Sun Apr 19 23:37:13 2020 +0200 @@ -1,6 +1,7 @@ local lfs = require "lfs"; local resolve_relative_path = require "core.configmanager".resolve_relative_path; +local envload = require "util.envload".envload; local logger = require "util.logger".init; local it = require "util.iterators"; local set = require "util.set"; @@ -543,7 +544,7 @@ -- a value to be returned on PASS local function compile_handler(code_string, filename) -- Prepare event handler function - local chunk, err = loadstring(code_string, "="..filename); + local chunk, err = envload(code_string, "="..filename, _G); if not chunk then return nil, "Error compiling (probably a compiler bug, please report): "..err; end