Skip to content

Commit

Permalink
fix recaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
dedblood94 committed Dec 27, 2023
1 parent 33094f1 commit 9117489
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public_html/core/engine/form.php
Expand Up @@ -685,7 +685,7 @@ public function validateFormData($data = [])
if ($field['element_type'] == 'K' || $field['element_type'] == 'J') { if ($field['element_type'] == 'K' || $field['element_type'] == 'J') {
if ($this->config->get('config_recaptcha_secret_key')) { if ($this->config->get('config_recaptcha_secret_key')) {
$recaptcha = new ReCaptcha($this->config->get('config_recaptcha_secret_key')); $recaptcha = new ReCaptcha($this->config->get('config_recaptcha_secret_key'));
$resp = $recaptcha->verify($data['g-recaptcha-response'], $this->request->getRemoteIP()); $resp = $recaptcha->verify($data['g-recaptcha-response'] ?:$data['captcha'], $this->request->getRemoteIP());
if (!$resp->isSuccess() && $resp->getErrorCodes()) { if (!$resp->isSuccess() && $resp->getErrorCodes()) {
$errors[$field['field_name']] = $this->language->get('error_captcha'); $errors[$field['field_name']] = $this->language->get('error_captcha');
} }
Expand Down
2 changes: 1 addition & 1 deletion public_html/storefront/model/account/customer.php
Expand Up @@ -704,7 +704,7 @@ public function validateRegistrationData($data)
if ($this->config->get('config_recaptcha_secret_key')) { if ($this->config->get('config_recaptcha_secret_key')) {
$recaptcha = new ReCaptcha($this->config->get('config_recaptcha_secret_key')); $recaptcha = new ReCaptcha($this->config->get('config_recaptcha_secret_key'));
$resp = $recaptcha->verify( $resp = $recaptcha->verify(
$data['g-recaptcha-response'], $data['g-recaptcha-response'] ?:$data['captcha'] ?:$data['recaptcha'],
$this->request->getRemoteIP() $this->request->getRemoteIP()
); );
if (!$resp->isSuccess() && $resp->getErrorCodes()) { if (!$resp->isSuccess() && $resp->getErrorCodes()) {
Expand Down

0 comments on commit 9117489

Please sign in to comment.