luci-lua-runtime: also search luci.dispatcher scope when looking up values
authorJo-Philipp Wich <redacted>
Wed, 9 Nov 2022 19:37:54 +0000 (20:37 +0100)
committerJo-Philipp Wich <redacted>
Wed, 9 Nov 2022 19:37:54 +0000 (20:37 +0100)
commitfd7427c4e50564c2428377259f988df4ed785733
tree0fa97aa80dea538f0047c749ee42db23b5b01ef2
parentbdfdd95a273f6fc73017795805dcfe6ee1ae8a8e
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 <redacted>
modules/luci-lua-runtime/luasrc/template.lua
git clone https://git.99rst.org/PROJECT