Make GetUriParam work with special characters (eg. "&") (#793)

This commit is contained in:
Marc Ole Bulling
2020-04-23 20:48:48 +02:00
committed by GitHub
parent 5833bb1e8f
commit 49e5eda30f

View File

@@ -23,7 +23,7 @@ String.prototype.replaceAll = function(search, replacement)
GetUriParam = function(key) GetUriParam = function(key)
{ {
var currentUri = decodeURIComponent(window.location.search.substring(1)); var currentUri = window.location.search.substring(1);
var vars = currentUri.split('&'); var vars = currentUri.split('&');
for (i = 0; i < vars.length; i++) for (i = 0; i < vars.length; i++)
@@ -32,7 +32,7 @@ GetUriParam = function(key)
if (currentParam[0] === key) if (currentParam[0] === key)
{ {
return currentParam[1] === undefined ? true : currentParam[1]; return currentParam[1] === undefined ? true : decodeURIComponent(currentParam[1]);
} }
} }
}; };