summaryrefslogtreecommitdiffhomepage
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/dispatcher.lua2
-rw-r--r--core/src/template.lua3
2 files changed, 3 insertions, 2 deletions
diff --git a/core/src/dispatcher.lua b/core/src/dispatcher.lua
index c60e5dcd1..0a66ccd3a 100644
--- a/core/src/dispatcher.lua
+++ b/core/src/dispatcher.lua
@@ -104,7 +104,7 @@ function build_url(category, module, action)
module = module or "index"
action = action or "index"
- local pattern = ffluci.http.env.SCRIPT_NAME .. "/%s/%s/%s"
+ local pattern = ffluci.http.dispatcher() .. "/%s/%s/%s"
return pattern:format(category, module, action)
end
diff --git a/core/src/template.lua b/core/src/template.lua
index e74db7d64..6f4e4adb0 100644
--- a/core/src/template.lua
+++ b/core/src/template.lua
@@ -52,7 +52,8 @@ compiler_enable_bytecode = false
viewns = {
translate = function(...) return require("ffluci.i18n").translate(...) end,
config = function(...) return require("ffluci.model.uci").get(...) or "" end,
- controller = ffluci.http.env.SCRIPT_NAME or "",
+ controller = ffluci.http.dispatcher(),
+ uploadctrl = ffluci.http.dispatcher_upload(),
media = ffluci.config.main.mediaurlbase,
images = ffluci.config.main.imagebase,
write = io.write,