[ZendTo] Recaptcha not showing + China

Kris Lou klou at themusiclink.net
Tue Mar 21 21:23:20 GMT 2023


With the CloudFlare Turnstile Site Key (as recaptchaPublicKey), Secret Key
(as recaptchaPrivateKey) and using "?compat=recaptcha", the following seems
to work.

/opt/zendto/templates/header.tpl
43,44c43,44
<             grecaptcha.render('google-recaptcha', {
<               'sitekey' : '{$recaptchaSiteKey}'
---
>             grecaptcha.render('cf-turnstile', {
>             'sitekey' : '{$recaptchaSiteKey}'
51c51,52
<         <script src="
https://www.recaptcha.net/recaptcha/api.js?hl={$recaptchaLang}" async
defer></script>
---
> <!--        <script src="
https://www.recaptcha.net/recaptcha/api.js?hl={$recaptchaLang}" async
defer></script> -->
>       <script src="
https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha"
async defer></script>
53c54,55
<         <script src="
https://www.recaptcha.net/recaptcha/api.js?hl={$recaptchaLang}&onload=onloadCallback&render=explicit"
async defer></script>
---
> <!--        <script src="
https://www.recaptcha.net/recaptcha/api.js?hl={$recaptchaLang}&onload=onloadCallback&render=explicit"
async defer></script> -->
>       <script src="
https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha"
async defer></script>

/opt/zendto/templates/pickupcheck.tpl
29c29,30
<                 <div id="google-recaptcha" name="google-recaptcha"></div>
---
> <!--                <div id="google-recaptcha"
name="google-recaptcha"></div> -->
>               <div class="cf-turnstile"
data-sitekey="{$recaptchaSiteKey}" data-callback="javascriptCallback"></div>

/opt/zendto/templates/verify.tpl
155c155,156
<                 <div id="google-recaptcha" name="google-recaptcha"></div>
---
> <!--                <div id="google-recaptcha"
name="google-recaptcha"></div> -->
>               <div class="cf-turnstile"
data-sitekey="{$recaptchaSiteKey}" data-callback="javascriptCallback"></div>

/opt/zendto/www/ReCaptcha/RequestMethod/CurlPost.php
43,44c43,44
<     const SITE_VERIFY_URL = '
https://www.recaptcha.net/recaptcha/api/siteverify';
<
---
> //    const SITE_VERIFY_URL = '
https://www.recaptcha.net/recaptcha/api/siteverify';
>     const SITE_VERIFY_URL = '
https://challenges.cloudflare.com/turnstile/v0/siteverify';



Kris Lou
klou at themusiclink.net


On Fri, Mar 17, 2023 at 3:21 AM <jules at zend.to> wrote:

> Kris,
>
> The method I use is CurlPost. So the erroneous URL in Post.php doesn't get
> used anyway.
>
> Cheers,
> Jules.
>
> On 16/03/2023 00:12, Kris Lou via ZendTo wrote:
>
> Looking into this a little further (also to play around with Turnstile),
> I'm noticing the following:
>
> # grep -R siteverify *
> ReCaptcha/ReCaptcha.php:     * Calls the reCAPTCHA siteverify API to
> verify whether the user passes
> ReCaptcha/RequestMethod/CurlPost.php:    const SITE_VERIFY_URL = '
> https://www.recaptcha.net/recaptcha/api/siteverify';
> ReCaptcha/RequestMethod/Post.php:    const SITE_VERIFY_URL = '
> https://www.google.com/recaptcha/api/siteverify';
> ReCaptcha/RequestMethod/SocketPost.php:    const SITE_VERIFY_PATH =
> '/recaptcha/api/siteverify';
>
> Are Post.php and SocketPost.php supposed to reference the google.com
> path, or the recaptcha.net URLs?
>
> _______________________________________________
> ZendTo mailing listZendTo at zend.tohttp://jul.es/mailman/listinfo/zendto
>
>
> Jules
>
> --
> Julian Field MEng CEng CITP MBCS MIEEE MACM
>
> 'It's okay to live without all the answers' - Charlie Eppes, 2011
> www.Zend.To
> Twitter: @JulesFM
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jul.es/pipermail/zendto/attachments/20230321/e4ec5540/attachment-0001.html>


More information about the ZendTo mailing list