-{if !$__wcf->user->userID}
- <script data-relocate="true" src="http{if $__wcf->secureConnection()}s{/if}://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
-{/if}
<script data-relocate="true">
//<![CDATA[
$(function() {
</dd>
{if !$ajaxCaptcha|isset || !$ajaxCaptcha}
- <script data-relocate="true" src="http{if $recaptchaUseSSL}s{/if}://www.google.com/recaptcha/api/challenge?k={$recaptchaPublicKey}"></script>
+ <script data-relocate="true" src="//www.google.com/recaptcha/api/challenge?k={$recaptchaPublicKey}"></script>
<noscript>
<dd>
- <iframe src="http{if $recaptchaUseSSL}s{/if}://www.google.com/recaptcha/api/noscript?k={$recaptchaPublicKey}" height="300" width="500" seamless="seamless"></iframe><br />
+ <iframe src="//www.google.com/recaptcha/api/noscript?k={$recaptchaPublicKey}" height="300" width="500" seamless="seamless"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
</dd>
{else}
<script data-relocate="true">
//<![CDATA[
- Recaptcha.create("{$recaptchaPublicKey}", "recaptcha_image", {
- lang: '{@$recaptchaLanguageCode}',
- theme : 'custom'
- });
-
- WCF.System.Captcha.addCallback('{$captchaID}', function() {
- return {
- recaptcha_challenge_field: Recaptcha.get_challenge(),
- recaptcha_response_field: Recaptcha.get_response()
- };
+ $.getScript('//www.google.com/recaptcha/api/js/recaptcha_ajax.js', function() {
+ Recaptcha.create("{$recaptchaPublicKey}", "recaptcha_image", {
+ lang: '{@$recaptchaLanguageCode}',
+ theme : 'custom'
+ });
+
+ WCF.System.Captcha.addCallback('{$captchaID}', function() {
+ return {
+ recaptcha_challenge_field: Recaptcha.get_challenge(),
+ recaptcha_response_field: Recaptcha.get_response()
+ };
+ });
});
//]]>
</script>
</dd>
{if !$ajaxCaptcha|isset || !$ajaxCaptcha}
- <script data-relocate="true" src="http{if $recaptchaUseSSL}s{/if}://www.google.com/recaptcha/api/challenge?k={$recaptchaPublicKey}"></script>
+ <script data-relocate="true" src="//www.google.com/recaptcha/api/challenge?k={$recaptchaPublicKey}"></script>
<noscript>
<dd>
- <iframe src="http{if $recaptchaUseSSL}s{/if}://www.google.com/recaptcha/api/noscript?k={$recaptchaPublicKey}" height="300" width="500" seamless="seamless"></iframe><br />
+ <iframe src="//www.google.com/recaptcha/api/noscript?k={$recaptchaPublicKey}" height="300" width="500" seamless="seamless"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
</dd>
{else}
<script data-relocate="true">
//<![CDATA[
- Recaptcha.create("{$recaptchaPublicKey}", "recaptcha_image", {
- lang: '{@$recaptchaLanguageCode}',
- theme : 'custom'
- });
-
- WCF.System.Captcha.addCallback('{$captchaID}', function() {
- return {
- recaptcha_challenge_field: Recaptcha.get_challenge(),
- recaptcha_response_field: Recaptcha.get_response()
- };
+ $.getScript('//www.google.com/recaptcha/api/js/recaptcha_ajax.js', function() {
+ Recaptcha.create("{$recaptchaPublicKey}", "recaptcha_image", {
+ lang: '{@$recaptchaLanguageCode}',
+ theme : 'custom'
+ });
+
+ WCF.System.Captcha.addCallback('{$captchaID}', function() {
+ return {
+ recaptcha_challenge_field: Recaptcha.get_challenge(),
+ recaptcha_response_field: Recaptcha.get_response()
+ };
+ });
});
//]]>
</script>
return $data['updates'];
}
- /**
- * @see \wcf\system\request\RouteHandler::secureConnection()
- */
- public function secureConnection() {
- return RouteHandler::secureConnection();
- }
-
/**
* Returns a 8 character prefix for editor autosave.
*
WCF::getTPL()->assign(array(
'recaptchaLanguageCode' => $this->languageCode,
'recaptchaPublicKey' => $this->publicKey,
- 'recaptchaUseSSL' => RouteHandler::secureConnection(),
+ 'recaptchaUseSSL' => RouteHandler::secureConnection(), // @deprecated since 2.1
'recaptchaLegacyMode' => true
));
}