From: Tim Düsterhus Date: Tue, 22 Aug 2017 14:16:36 +0000 (+0200) Subject: Use separate keys for invisble captcha X-Git-Tag: 3.1.0_Alpha_2~44 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7c4b6e24fde244dd87d7e5da43103b1492f28e46;p=GitHub%2FWoltLab%2FWCF.git Use separate keys for invisble captcha Technically keys for invisible captcha seem to work for stock v2, but according to the documentation they should not. Better play safe here. Closes #2242 --- diff --git a/com.woltlab.wcf/option.xml b/com.woltlab.wcf/option.xml index 9c49adafa5..325202450a 100644 --- a/com.woltlab.wcf/option.xml +++ b/com.woltlab.wcf/option.xml @@ -769,6 +769,18 @@ private:wcf.acp.option.exception_privacy.private ^[^/]*$ 2 + + diff --git a/com.woltlab.wcf/templates/recaptcha.tpl b/com.woltlab.wcf/templates/recaptcha.tpl index 1b5e9e8e46..ce0a66293e 100644 --- a/com.woltlab.wcf/templates/recaptcha.tpl +++ b/com.woltlab.wcf/templates/recaptcha.tpl @@ -95,7 +95,7 @@ {else} - {if $supportsAsyncCaptcha|isset && $supportsAsyncCaptcha} + {if $supportsAsyncCaptcha|isset && $supportsAsyncCaptcha && RECAPTCHA_PUBLICKEY_INVISIBLE && RECAPTCHA_PRIVATEKEY_INVISIBLE}

{lang}wcf.recaptcha.title{/lang}

{assign var="recaptchaBucketID" value=true|microtime|sha1} @@ -108,7 +108,7 @@
- +
@@ -155,7 +155,7 @@ var promise = new Promise(function (resolve, reject) { WCF.recaptcha.mapping['recaptchaBucket{$recaptchaBucketID}'] = grecaptcha.render(bucket, { - sitekey: '{RECAPTCHA_PUBLICKEY|encodeJS}', + sitekey: '{RECAPTCHA_PUBLICKEY_INVISIBLE|encodeJS}', size: 'invisible', badge: 'inline', callback: resolve diff --git a/wcfsetup/install/files/acp/templates/recaptcha.tpl b/wcfsetup/install/files/acp/templates/recaptcha.tpl index 1b5e9e8e46..ce0a66293e 100644 --- a/wcfsetup/install/files/acp/templates/recaptcha.tpl +++ b/wcfsetup/install/files/acp/templates/recaptcha.tpl @@ -95,7 +95,7 @@
{else} - {if $supportsAsyncCaptcha|isset && $supportsAsyncCaptcha} + {if $supportsAsyncCaptcha|isset && $supportsAsyncCaptcha && RECAPTCHA_PUBLICKEY_INVISIBLE && RECAPTCHA_PRIVATEKEY_INVISIBLE}

{lang}wcf.recaptcha.title{/lang}

{assign var="recaptchaBucketID" value=true|microtime|sha1} @@ -108,7 +108,7 @@
- +
@@ -155,7 +155,7 @@ var promise = new Promise(function (resolve, reject) { WCF.recaptcha.mapping['recaptchaBucket{$recaptchaBucketID}'] = grecaptcha.render(bucket, { - sitekey: '{RECAPTCHA_PUBLICKEY|encodeJS}', + sitekey: '{RECAPTCHA_PUBLICKEY_INVISIBLE|encodeJS}', size: 'invisible', badge: 'inline', callback: resolve diff --git a/wcfsetup/install/files/lib/system/recaptcha/RecaptchaHandlerV2.class.php b/wcfsetup/install/files/lib/system/recaptcha/RecaptchaHandlerV2.class.php index e5e46be793..c5c3c97475 100644 --- a/wcfsetup/install/files/lib/system/recaptcha/RecaptchaHandlerV2.class.php +++ b/wcfsetup/install/files/lib/system/recaptcha/RecaptchaHandlerV2.class.php @@ -32,7 +32,7 @@ class RecaptchaHandlerV2 extends SingletonFactory { $key = RECAPTCHA_PRIVATEKEY; } else if ($type === 'invisible') { - $key = RECAPTCHA_PRIVATEKEY; + $key = RECAPTCHA_PRIVATEKEY_INVISIBLE; } else { throw new \InvalidArgumentException('$type must be either v2 or invisible.'); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 894dba3a6a..66c8992650 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1118,9 +1118,12 @@ - + reCAPTCHA beantragen.]]> - + + + zusätzlich zu den obigen Schlüsseln Schlüssel für das unsichtbare reCAPTCHA ein, wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if}diese Variante nutzen {if LANGUAGE_USE_INFORMAL_VARIANT}möchtest{else}möchten{/if}.]]> + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index bdbd86b1db..8343d50edf 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1101,9 +1101,12 @@ - + reCAPTCHA website.]]> - + + + in addition to the keys above if you want to use the invisible variant of reCAPTCHA.]]> +