diff --git a/lib/API/JSON/v1/Subscribers.php b/lib/API/JSON/v1/Subscribers.php index f776d15cf6..4608b8663b 100644 --- a/lib/API/JSON/v1/Subscribers.php +++ b/lib/API/JSON/v1/Subscribers.php @@ -323,7 +323,7 @@ class Subscribers extends APIEndpoint { return $this->badRequest([ APIError::BAD_REQUEST => WPFunctions::get()->__('Please regenerate the CAPTCHA.', 'mailpoet'), ]); - } elseif (!hash_equals(strtolower($data['captcha']), $captchaHash)) { + } elseif (!hash_equals(strtolower($data['captcha']), strtolower($captchaHash))) { $this->captchaSession->setCaptchaHash(null); $meta = []; $meta['refresh_captcha'] = true; diff --git a/tests/integration/API/JSON/v1/SubscribersTest.php b/tests/integration/API/JSON/v1/SubscribersTest.php index ba18ea8e4e..b8a8d71f41 100644 --- a/tests/integration/API/JSON/v1/SubscribersTest.php +++ b/tests/integration/API/JSON/v1/SubscribersTest.php @@ -555,7 +555,7 @@ class SubscribersTest extends \MailPoetTest { $subscriber->email = $email; $subscriber->countConfirmations = 1; $subscriber->save(); - $captchaValue = 'ihg5w'; + $captchaValue = 'ihG5W'; $captchaSessionId = 'abcdfgh'; $this->captchaSession->init($captchaSessionId); $this->captchaSession->setCaptchaHash($captchaValue);