Fix captcha case in comparison [MAILPOET-2698]
This commit is contained in:
@ -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;
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user