Fix the validation of reCAPTCHA in dialogs
authorAlexander Ebert <ebert@woltlab.com>
Mon, 23 Dec 2024 16:23:21 +0000 (17:23 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 23 Dec 2024 16:23:21 +0000 (17:23 +0100)
See https://www.woltlab.com/community/thread/310067-gastkommentar-absenden-noch-immer-nicht-m%C3%B6glich/

com.woltlab.wcf/templates/shared_recaptcha.tpl

index ed73e39c9e499c6ae1c4240a9b16bf379a3d3958..bebd82322abce406e73c17c1918e524c15ce7737 100644 (file)
                        WCF.recaptcha.queue.push({
                                bucket: 'recaptchaBucket{$recaptchaBucketID}'
                                {if $ajaxCaptcha|isset && $ajaxCaptcha}
-                                       , ajaxCaptcha: '{$captchaID}'
+                                       , ajaxCaptcha: '{unsafe:$captchaID|encodeJS}'
                                {/if}
                        });
                        
                        if (WCF.recaptcha.callbackCalled) setTimeout(recaptchaCallback, 1);
                        
                        {if $ajaxCaptcha|isset && $ajaxCaptcha}
-                       WCF.System.Captcha.addCallback('{$captchaID}', function() {
+                       WCF.System.Captcha.addCallback('{unsafe:$captchaID|encodeJS}', function() {
                                return {
                                        'g-recaptcha-response': grecaptcha.getResponse(WCF.recaptcha.mapping['recaptchaBucket{$recaptchaBucketID}']),
                                        'type': 'v2'