summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/http.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/ffluci/http.lua')
-rw-r--r--src/ffluci/http.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ffluci/http.lua b/src/ffluci/http.lua
index b7ce92ffab..06e1c43bda 100644
--- a/src/ffluci/http.lua
+++ b/src/ffluci/http.lua
@@ -54,11 +54,17 @@ function request_redirect(category, module, action, ...)
module = module or "index"
action = action or "index"
- local pattern = os.getenv("SCRIPT_NAME") .. "/%s/%s/%s"
+ local pattern = script_name() .. "/%s/%s/%s"
redirect(pattern:format(category, module, action), ...)
end
+-- Returns the script name
+function script_name()
+ return ENV.SCRIPT_NAME
+end
+
+
-- Gets form value from key
function formvalue(key, default)
local c = formvalues()