Skip to content

Commit

Permalink
feat(): recaptcha globally
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMarquezF committed Oct 5, 2021
1 parent a300807 commit e4aaac1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions recaptchav2/recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function validateEntry($value)

$config = $this->getPluginConfig()->getInfo();
if (count(parent::errors()) === 0) {
$response = json_decode(file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $config['g-secret-key'] . '&response=' . $value));
$response = json_decode(file_get_contents('https://www.recaptcha.net/recaptcha/api/siteverify?secret=' . $config['g-secret-key'] . '&response=' . $value));

if ($response == FALSE) {
$this->addError('Unable to communicate with the reCaptcha server');
Expand Down Expand Up @@ -70,7 +70,7 @@ function render()

?>
<div id="<?php echo $this->id; ?>" style="display:flex;justify-content:center;" class="g-recaptcha" data-sitekey="<?php echo $pconfig['g-site-key']; ?>" data-theme="<?php echo $fconfig['theme'] ?: 'light'; ?>" data-type="<?php echo $fconfig['type'] ?: 'image'; ?>" data-size="<?php echo $fconfig['size'] ?: 'normal'; ?>"></div>
<script src="https://www.google.com/recaptcha/api.js" type="application/javascript" async defer></script>
<script src="https://www.recaptcha.net/recaptcha/api.js" type="application/javascript" async defer></script>
<?php
}
function getValue()
Expand Down

0 comments on commit e4aaac1

Please sign in to comment.