From 5f5b99bce35ccd633ced72153b625b9070ced6ff Mon Sep 17 00:00:00 2001 From: Fabien NICOLLET Date: Sun, 18 Sep 2022 22:36:51 +0200 Subject: [PATCH] Fix URL creation when it contains a "?" character Fixes #2 --- src/jquery-captcha.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery-captcha.js b/src/jquery-captcha.js index 2080eef..87758e0 100644 --- a/src/jquery-captcha.js +++ b/src/jquery-captcha.js @@ -96,7 +96,7 @@ // load botdetect scripts and execute them function _loadScriptIncludes() { var captchaId = $('#BDC_VCID_' + captchaStyleName).val(); - var scriptIncludeUrl = settings.captchaEndpoint + '?get=script-include&c=' + captchaStyleName + '&t=' + captchaId + '&cs=2'; + var scriptIncludeUrl = settings.captchaEndpoint + (settings.captchaEndpoint.indexOf('?') == -1 ? '?' : '&') + 'get=script-include&c=' + captchaStyleName + '&t=' + captchaId + '&cs=2'; _getScript(scriptIncludeUrl).done(function() { setTimeout(_onLoadScriptsSuccess, 200); });