Fix parsing of query string variables
This space that was added here was added to the parsed value of the
query variable. This broke any comparisons with the value, for example
"myvar=true" resulted in a value of "true ".
This was broken by f796b05e42
The commit also adds unit tests for webutil.getConfigVar() that will
detect problems like this in the future.
This commit is contained in:
@@ -32,7 +32,7 @@ export function initLogging(level) {
|
||||
export function getQueryVar(name, defVal) {
|
||||
"use strict";
|
||||
const re = new RegExp('.*[?&]' + name + '=([^&#]*)'),
|
||||
match = ''.concat(document.location.href, " ", window.location.hash).match(re);
|
||||
match = ''.concat(document.location.href, window.location.hash).match(re);
|
||||
if (typeof defVal === 'undefined') { defVal = null; }
|
||||
|
||||
if (match) {
|
||||
|
||||
Reference in New Issue
Block a user