Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/config/recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,16 @@

'version' => 2,

/*
|--------------------------------------------------------------------------
| Recaptcha domain
|--------------------------------------------------------------------------
|
| This can be set either to www.google.com or www.recaptcha.net for use in
| locations where www.google.com is not available
| https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
|
*/
'recaptcha_domain' => 'www.google.com'

];
4 changes: 2 additions & 2 deletions src/views/captcha.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
</script>
@endif
<script type="text/javascript"
src="//www.google.com/recaptcha/api/challenge?k=<?php echo $public_key ?><?php echo( isset( $lang ) ? '&hl=' . $lang : '' ) ?>"></script>
src="//{{ config('recaptcha.recaptcha_domain', 'www.google.com') }}/recaptcha/api/challenge?k=<?php echo $public_key ?><?php echo( isset( $lang ) ? '&hl=' . $lang : '' ) ?>"></script>
<noscript>
<iframe src="//www.google.com/recaptcha/api/noscript?k=<?php echo $public_key ?><?php echo( isset( $lang ) ? '&hl=' . $lang : '' ) ?>"
<iframe src="//{{ config('recaptcha.recaptcha_domain', 'www.google.com') }}/recaptcha/api/noscript?k=<?php echo $public_key ?><?php echo( isset( $lang ) ? '&hl=' . $lang : '' ) ?>"
height="300" width="500" frameborder="0"></iframe>
<br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
Expand Down
4 changes: 2 additions & 2 deletions src/views/captchav2.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ function renderDataAttributes($attributes)
var RecaptchaOptions = <?=json_encode($options) ?>;
</script>
@endif
<script src='https://www.google.com/recaptcha/api.js?render=onload{{ (isset($lang) ? '&hl='.$lang : '') }}'></script>
<script src='https://{{ config('recaptcha.recaptcha_domain', 'www.google.com') }}/recaptcha/api.js?render=onload{{ (isset($lang) ? '&hl='.$lang : '') }}'></script>
<div class="g-recaptcha" data-sitekey="{{ $public_key }}" <?=renderDataAttributes($dataParams)?>></div>
<noscript>
<div style="width: 302px; height: 352px;">
<div style="width: 302px; height: 352px; position: relative;">
<div style="width: 302px; height: 352px; position: absolute;">
<iframe src="https://www.google.com/recaptcha/api/fallback?k={{ $public_key }}"
<iframe src="https://{{ config('recaptcha.recaptcha_domain', 'www.google.com') }}/recaptcha/api/fallback?k={{ $public_key }}"
frameborder="0" scrolling="no"
style="width: 302px; height:352px; border-style: none;">
</iframe>
Expand Down