Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/luci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-11-09 22:37:54 +0300
committerJo-Philipp Wich <jo@mein.io>2022-11-09 22:37:54 +0300
commitfd7427c4e50564c2428377259f988df4ed785733 (patch)
tree0fa97aa80dea538f0047c749ee42db23b5b01ef2 /modules
parentbdfdd95a273f6fc73017795805dcfe6ee1ae8a8e (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.lua2
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})