From 9634086efc6d58224899037c92c896ab27373d8a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 13 Jan 2023 21:15:03 +0100 Subject: [PATCH] luci-base: dispatcher.uc: urldecode URL components In order to maintain compatibility with the old Lua runtime, ensure to URL decode the request path segments since they might end up as arguments to invoked action functions. Signed-off-by: Jo-Philipp Wich --- modules/luci-base/ucode/dispatcher.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc index 9500528743..24769f0037 100644 --- a/modules/luci-base/ucode/dispatcher.uc +++ b/modules/luci-base/ucode/dispatcher.uc @@ -892,7 +892,7 @@ dispatch = function(_http, path) { try { let menu = menu_json(); - path ??= map(match(http.getenv('PATH_INFO'), /[^\/]+/g), m => m[0]); + path ??= map(match(http.getenv('PATH_INFO'), /[^\/]+/g), m => urldecode(m[0])); let resolved = resolve_page(menu, path); -- 2.30.2