From 91f53552c9a1efd5753865b79792a09d636f46e5 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sat, 8 Feb 2025 21:30:25 +0100 Subject: [PATCH] ajax.js: trigger the captcha only if present and needed --- js/ajax.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/ajax.js b/js/ajax.js index 0401cca7..f65c6c96 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -24,10 +24,12 @@ $(window).ready(function() { if (do_not_ajax) return true; - // In the captcha is present, halt if it does not have a response.. - if (captcha_renderer && postCaptchaId && !captcha_renderer.hasResponse(postCaptchaId)) { - captcha_renderer.execute(postCaptchaId); - return false; + // 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;