ajax.js: trigger the captcha only if present and needed

This commit is contained in:
Zankaria 2025-02-08 21:30:25 +01:00
parent 262e8971bd
commit 91f53552c9

View file

@ -24,11 +24,13 @@ $(window).ready(function() {
if (do_not_ajax)
return true;
// In the captcha is present, halt if it does not have a response..
// If the captcha is present, halt if it does not have a response.
if (captchaMode === 'static' || (captchaMode === 'dynamic' && isDynamicCaptchaEnabled())) {
if (captcha_renderer && postCaptchaId && !captcha_renderer.hasResponse(postCaptchaId)) {
captcha_renderer.execute(postCaptchaId);
return false;
}
}
var form = this;
var submit_txt = $(this).find('input[type="submit"]').val();