From d8c09535679ebb60e09bb337c42fd542340a3814 Mon Sep 17 00:00:00 2001 From: Giannis Kosmas Date: Mon, 5 May 2014 23:23:48 +0300 Subject: [PATCH] Better parsing of query string variables --- include/webutil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/webutil.js b/include/webutil.js index 5ceccbef..e95fc807 100644 --- a/include/webutil.js +++ b/include/webutil.js @@ -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) {