Skip to content

Commit

Permalink
Update google.php
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter authored Dec 31, 2023
1 parent 43c42f5 commit eb00194
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions upload/catalog/controller/extension/captcha/google.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ public function validate(): string {
$recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('captcha_google_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);
$recaptcha = json_decode($recaptcha, true);

if ($recaptcha['success']) {
$this->session->data['gcaptcha'] = '';

return '';
} else {
if ((!isset($recaptcha['success']) || !$recaptcha['success']) || (!isset($this->session->data['gcaptcha'])) || ($this->session->data['gcaptcha'] != $this->request->post['g-recaptcha-response'])) {
return $this->language->get('error_captcha');
} else {
return $this->session->data['gcaptcha'] = '';
}
}
}
Expand Down

0 comments on commit eb00194

Please sign in to comment.