diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-11-09 22:37:54 +0300 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-11-09 22:37:54 +0300 |
commit | fd7427c4e50564c2428377259f988df4ed785733 (patch) | |
tree | 0fa97aa80dea538f0047c749ee42db23b5b01ef2 /modules | |
parent | bdfdd95a273f6fc73017795805dcfe6ee1ae8a8e (diff) |
luci-lua-runtime: also search luci.dispatcher scope when looking up values
Some legacy templates access dispatcher functions such as `build_url()`
without explicit scope, which worked in the old runtime since the template
view namespace was instantiated from the dispatcher.
Ensure that this continues to function in the emulated runtime.
Fixes: #6082
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-lua-runtime/luasrc/template.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-lua-runtime/luasrc/template.lua b/modules/luci-lua-runtime/luasrc/template.lua index b6b9af0bad..84fb8bb338 100644 --- a/modules/luci-lua-runtime/luasrc/template.lua +++ b/modules/luci-lua-runtime/luasrc/template.lua @@ -121,7 +121,7 @@ context.viewns = setmetatable({ elseif key == "resource" then return L.config.main.resourcebase else - return rawget(tbl, key) or _G[key] or L[key] + return rawget(tbl, key) or disp[key] or _G[key] or L[key] end end}) |