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>
This commit is contained in:
parent
bdfdd95a27
commit
fd7427c4e5
1 changed files with 1 additions and 1 deletions
|
@ -121,7 +121,7 @@ context.viewns = setmetatable({
|
||||||
elseif key == "resource" then
|
elseif key == "resource" then
|
||||||
return L.config.main.resourcebase
|
return L.config.main.resourcebase
|
||||||
else
|
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
|
||||||
end})
|
end})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue