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 <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2023-01-13 21:15:03 +01:00
parent b49fb7b42e
commit 9634086efc

View file

@ -892,7 +892,7 @@ dispatch = function(_http, path) {
try { try {
let menu = menu_json(); 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); let resolved = resolve_page(menu, path);