luci-base, luci-lua-runtime: adjust Lua template environment
authorJo-Philipp Wich <jo@mein.io>
Mon, 21 Nov 2022 11:27:28 +0000 (12:27 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 21 Nov 2022 11:27:28 +0000 (12:27 +0100)
commitfa17c1573f88c24a8e7d7d6dce67ad0d27486084
tree7b5ac71ef037872a684b61d9eb8ed32aa4f57056
parent08ae8d40a939654d2e4a1774853c5c5683b12268
luci-base, luci-lua-runtime: adjust Lua template environment

To maintain full compatibility with the old Lua runtime, templates
rendered from a menu `template()` action must implicitly inherit the
`luci.dispatcher` namespace as scope while other indirectly included
templates must not.

Fixes: #6105
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/ucode/dispatcher.uc
modules/luci-lua-runtime/luasrc/dispatcher.lua
modules/luci-lua-runtime/luasrc/template.lua