1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-24 11:22:42 +01:00

Properly process arrays in getQueryParam()

This commit is contained in:
FreeScout 2020-11-25 06:11:02 -08:00
parent bd81680cdb
commit 40e8d39f75

15
public/js/main.js vendored
View File

@ -1945,6 +1945,21 @@ function getQueryParam(name, qs) {
params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
}
// Process arrays
for (var param in params) {
var m = param.match(/^([^\[]+)\[([^\[]+)\]$/i);
if (m && m.length) {
if (typeof(params[m[1]]) == "undefined") {
params[m[1]] = {};
}
if (typeof(params[m[1]]) == "object") {
params[m[1]][m[2]] = params[param];
}
}
}
if (typeof(params[name]) != "undefined") {
return params[name];
} else {