? Pending

User tests: Successful: Unsuccessful:

avatar piotr-cz
piotr-cz
9 Oct 2016

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

Summary of Changes

Checking if response error codes format is an array.

Testing Instructions

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

Documentation Changes Required

none

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar piotr-cz piotr-cz - open - 9 Oct 2016
avatar piotr-cz piotr-cz - change - 9 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2016
Category Front End Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2016
Labels Added: ?
avatar zero-24 zero-24 - change - 9 Oct 2016
Milestone Added:
avatar brianteeman brianteeman - change - 17 Oct 2016
Milestone Removed:
avatar brianteeman brianteeman - change - 17 Oct 2016
Milestone Added:
avatar brianteeman brianteeman - change - 17 Oct 2016
Milestone Added:
avatar brianteeman brianteeman - change - 17 Oct 2016
Milestone Removed:
avatar Fedik
Fedik - comment - 1 Nov 2016

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.

avatar Fedik Fedik - test_item - 1 Nov 2016 - Tested successfully
avatar Fedik
Fedik - comment - 1 Nov 2016

other possible fix is to make $errorCodes property as an array by default

class JReCaptchaResponse
{
    public $success;
    public $errorCodes = array();
}
avatar piotr-cz
piotr-cz - comment - 2 Nov 2016

@Fedik yes, that would be even better solution, few lines above errorCodes property is used to store a string.

avatar brianteeman
brianteeman - comment - 15 Nov 2016

@piotr-cz will you be updating this PR with @fedik suggestion?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12369.

avatar Fedik
Fedik - comment - 15 Nov 2016

@brianteeman it is fine as it is,
my suggestion can have small B/C issue, it is more safe as @piotr-cz made

avatar brianteeman
brianteeman - comment - 15 Nov 2016

Thanks for clarifying that I think people were waiting for an update before doing a code review

avatar rdeutz rdeutz - change - 17 Apr 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-04-17 14:11:24
Closed_By rdeutz
avatar rdeutz rdeutz - close - 17 Apr 2017
avatar rdeutz rdeutz - merge - 17 Apr 2017

Add a Comment

Login with GitHub to post a comment