applying compact design and updating error messages

This commit is contained in:
Amine Ben hammou
2017-12-19 14:56:02 +00:00
parent 2228f60e2a
commit 1ad0dce425
2 changed files with 4 additions and 4 deletions

View File

@ -92,7 +92,7 @@ class Subscribers extends APIEndpoint {
if($recaptcha['enabled'] && !isset($data['recaptcha'])) {
return $this->badRequest(array(
APIError::BAD_REQUEST => __('Please check the reCAPTCHA.', 'mailpoet')
APIError::BAD_REQUEST => __('Please check the captcha.', 'mailpoet')
));
}
@ -105,13 +105,13 @@ class Subscribers extends APIEndpoint {
));
if(is_wp_error($res)) {
return $this->badRequest(array(
APIError::BAD_REQUEST => __('Error while validating the reCAPTCHA.', 'mailpoet')
APIError::BAD_REQUEST => __('Error while validating the captcha.', 'mailpoet')
));
}
$res = json_decode($res['body']);
if(!$res->success) {
return $this->badRequest(array(
APIError::BAD_REQUEST => __('Error while validating the reCAPTCHA.', 'mailpoet')
APIError::BAD_REQUEST => __('Error while validating the captcha.', 'mailpoet')
));
}
}