User tests: Successful: Unsuccessful:
Pull Request for Issue -.
This is updated PR of #9305.
Captcha API may not return any error codes for failed check.
In this case the JRecaptcha::verifyResponse
doesn't return an array of error codes but an empty string (see https://github.com/joomla/joomla-cms/blob/3.6.2/plugins/captcha/recaptcha/recaptchalib.php#L142) and we get a PHP warning:
Warning: Invalid argument supplied for foreach() in [joomla]/plugins/captcha/recaptcha/recaptcha.php on line 205
Checking if response error codes format is an array.
I'm not sure how to trigger a recaptcha error without an error code, if I find out I'll update the testing intructions.
For now please do code review
none
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
Labels |
Added:
?
|
Milestone |
Added: |
Milestone |
Removed: |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
other possible fix is to make $errorCodes
property as an array
by default
class JReCaptchaResponse
{
public $success;
public $errorCodes = array();
}
@Fedik yes, that would be even better solution, few lines above errorCodes
property is used to store a string.
@piotr-cz will you be updating this PR with @fedik suggestion?
@brianteeman it is fine as it is,
my suggestion can have small B/C issue, it is more safe as @piotr-cz made
Thanks for clarifying that I think people were waiting for an update before doing a code review
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-17 14:11:24 |
Closed_By | ⇒ | rdeutz |
I have tested this item✅ successfully on 636bdc5
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12369.