Skip to content

Commit

Permalink
Better parsing of query string variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmasgiannis committed May 5, 2014
1 parent c77938e commit d8c0953
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/webutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ WebUtil.dirObj = function (obj, depth, parent) {

// Read a query string variable
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 (match) {
Expand Down

0 comments on commit d8c0953

Please sign in to comment.