Commit fa5b334d authored by Joel Martin's avatar Joel Martin

webutil.js: use decodeURIComponent on getQueryVar values.

parent fcff386b
...@@ -75,9 +75,14 @@ WebUtil.dirObj = function (obj, depth, parent) { ...@@ -75,9 +75,14 @@ WebUtil.dirObj = function (obj, depth, parent) {
// Read a query string variable // Read a query string variable
WebUtil.getQueryVar = function(name, defVal) { WebUtil.getQueryVar = function(name, defVal) {
var re = new RegExp('[?][^#]*' + name + '=([^&#]*)'); var re = new RegExp('[?][^#]*' + name + '=([^&#]*)'),
match = document.location.href.match(re);
if (typeof defVal === 'undefined') { defVal = null; } if (typeof defVal === 'undefined') { defVal = null; }
return (document.location.href.match(re) || ['',defVal])[1]; if (match) {
return decodeURIComponent(match[1]);
} else {
return defVal;
}
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment