mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Use mg.script_name to retrieve the scriptname
This value is independent from webhome or prefix Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -14,7 +14,8 @@ webhome = pihole.webhome()
|
||||
theme = pihole.webtheme()
|
||||
|
||||
-- Get name of script by matching whatever is after the last "/" in the URI
|
||||
scriptname = mg.request_info.request_uri:match(webhome.."(.*)$")
|
||||
scriptname = mg.script_name:match(".*/(.*).lp$"):gsub("-", "/")
|
||||
|
||||
-- Fall back to "index.lp" if no match is found (e.g. when accessing the root)
|
||||
if scriptname == nil or string.len(scriptname) == 0 then scriptname = "index.lp" end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user