Fix WooCommerce lost password captcha #12

Merged
ogrecooper merged 4 commits from wc-lost-password-fix into main 2026-08-26 22:33:18 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 958376cafd - Show all commits
+1 -1
View File
@@ -63,7 +63,7 @@ final class API {
if (empty($token)) { if (empty($token)) {
$errors->add(self::ERROR_EMPTY_TOKEN, Plugin::__('Please complete CAPTCHA verification.')); $errors->add(self::ERROR_EMPTY_TOKEN, Plugin::__('Please complete CAPTCHA verification.'));
} else if (!API::verify($token)) { } else if (!self::verify($token)) {
$errors->add(self::ERROR_INVALID_CAPTCHA, Plugin::__('Your answer was incorrect - please try again.')); $errors->add(self::ERROR_INVALID_CAPTCHA, Plugin::__('Your answer was incorrect - please try again.'));
} }
@@ -37,7 +37,7 @@ final class LostPassword extends Location {
add_action('woocommerce_lostpassword_form', [$this, 'render']); add_action('woocommerce_lostpassword_form', [$this, 'render']);
add_action('woocommerce_after_lost_password_form', [$this, 'footer']); add_action('woocommerce_after_lost_password_form', [$this, 'footer']);
if (isset($_POST['woocommerce-lost-password-nonce'])) { if (isset($_POST['woocommerce-lost-password-nonce'])) {
add_action('lostpassword_post', [$this, 'process_form']); add_action('lostpassword_post', [$this, 'process_form'], 10, 2);
} }
} }