From 37468c99a3851c67d82e9c9307547188d6ca23f5 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 8 Nov 2022 15:23:10 +0000 Subject: [PATCH] lua-runtime: template: fix "tpl" refactoring This fixes crashes on "tpl" being undefined. Signed-off-by: Karl Palsson --- modules/luci-lua-runtime/luasrc/template.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-lua-runtime/luasrc/template.lua b/modules/luci-lua-runtime/luasrc/template.lua index b7cc56e1cc..b6b9af0bad 100644 --- a/modules/luci-lua-runtime/luasrc/template.lua +++ b/modules/luci-lua-runtime/luasrc/template.lua @@ -95,7 +95,7 @@ context.viewns = setmetatable({ end; translate = i18n.translate; translatef = i18n.translatef; - export = function(k, v) if tpl.context.viewns[k] == nil then tpl.context.viewns[k] = v end end; + export = function(k, v) if context.viewns[k] == nil then context.viewns[k] = v end end; striptags = xml.striptags; pcdata = xml.pcdata; ifattr = function(...) return _ifattr(...) end;