From 44781602211ec920a55bea4e3329f77d5d6f0183 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 5 Nov 2020 13:46:53 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20getUrlQuery=20function=20not=20working=20?= =?UTF-8?q?correctly=20on=20server=20n=C2=B0=20>=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: William Desportes --- js/src/common.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/src/common.js b/js/src/common.js index 45bad3038c..f405632a41 100644 --- a/js/src/common.js +++ b/js/src/common.js @@ -86,6 +86,12 @@ var CommonParams = (function () { var sep = (typeof separator !== 'undefined') ? separator : '?'; var common = this.get('common_query'); var argsep = CommonParams.get('arg_separator'); + if (typeof common === 'string') { + // If the last char is the separator, do not add it + // Else add it + common = common.substr(common.length - 1, common.length) === argsep ? common : common + argsep; + } + return Functions.sprintf( '%s%sserver=%s' + argsep + 'db=%s' + argsep + 'table=%s', sep,