Fix captcha case in comparison [MAILPOET-2698]
This commit is contained in:
@ -323,7 +323,7 @@ class Subscribers extends APIEndpoint {
|
|||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => WPFunctions::get()->__('Please regenerate the CAPTCHA.', 'mailpoet'),
|
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);
|
$this->captchaSession->setCaptchaHash(null);
|
||||||
$meta = [];
|
$meta = [];
|
||||||
$meta['refresh_captcha'] = true;
|
$meta['refresh_captcha'] = true;
|
||||||
|
@ -555,7 +555,7 @@ class SubscribersTest extends \MailPoetTest {
|
|||||||
$subscriber->email = $email;
|
$subscriber->email = $email;
|
||||||
$subscriber->countConfirmations = 1;
|
$subscriber->countConfirmations = 1;
|
||||||
$subscriber->save();
|
$subscriber->save();
|
||||||
$captchaValue = 'ihg5w';
|
$captchaValue = 'ihG5W';
|
||||||
$captchaSessionId = 'abcdfgh';
|
$captchaSessionId = 'abcdfgh';
|
||||||
$this->captchaSession->init($captchaSessionId);
|
$this->captchaSession->init($captchaSessionId);
|
||||||
$this->captchaSession->setCaptchaHash($captchaValue);
|
$this->captchaSession->setCaptchaHash($captchaValue);
|
||||||
|
Reference in New Issue
Block a user