Skip to content

🟡 6. URL Parameter Not Decoded #159

@juancolchete

Description

@juancolchete

Location: static/js/utils.js:1-13

function GetURLParameter(sParam) {
    var sPageURL = window.location.search.substring(1);
    var sURLVariables = sPageURL.split('&');
    for (var i = 0; i < sURLVariables.length; i++) {
        var sParameterName = sURLVariables[i].split('=');
        if (sParameterName[0] == sParam) {
            return sParameterName[1];  // ❌ Not decoded
        }
    }
}

Fix: Use modern URLSearchParams API:

function GetURLParameter(sParam) {
    const params = new URLSearchParams(window.location.search)
    return params.get(sParam)  // Automatically decoded
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions