Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support for passing challenge/response manually #3

Merged
merged 2 commits into from Mar 26, 2013

Conversation

Projects
None yet
2 participants
Contributor

flack commented Mar 14, 2013

This makes integrations into frameworks a bit easier. If no values are passed, then the values will be read from $_POST as before, so that there is no BC break.

Not sure if I got your coding style right, feel free to correct as needed.

@flack flack Add support for passing challenge/response manually
This makes integrations into frameworks a bit easier. If no values are passed, then the values will be read from $_POST as before, so that there is no BC break. 

Not sure if I got your coding style right, feel free to correct as needed.
7fbad0b

@AlekseyKorzun AlekseyKorzun commented on an outdated diff Mar 16, 2013

Package/Captcha/Captcha.php
// Skip processing of empty data
- if (isset($_POST['recaptcha_challenge_field']) && isset($_POST['recaptcha_response_field'])) {
+ if ((strlen($captcha_challenge) == 0 || strlen($captcha_response) == 0) && isset($_POST['recaptcha_challenge_field']) && isset($_POST['recaptcha_response_field'])) {
@AlekseyKorzun

AlekseyKorzun Mar 16, 2013

Owner

Can you please do:

if (!$captcha_challenge && !$captcha_response) {
    if (isset($_POST['recaptcha_challenge_field']) && isset($_POST['recaptcha_response_field']) {

    }
}

To follow line width limit of PSR compliance and avoid treating default method values (false) as a string.

Thanks!

Owner

AlekseyKorzun commented Mar 16, 2013

Thanks for the pull request, made a minor comment as soon as you update it I will merge it.

Cheers!

Contributor

flack commented Mar 23, 2013

OK, I updated now as requested

@ghost ghost assigned AlekseyKorzun Mar 26, 2013

Owner

AlekseyKorzun commented Mar 26, 2013

Approved, thank you.

@AlekseyKorzun AlekseyKorzun added a commit that referenced this pull request Mar 26, 2013

@AlekseyKorzun AlekseyKorzun Merge pull request #3 from flack/patch-1
Add support for passing challenge/response manually
6fc690f

@AlekseyKorzun AlekseyKorzun merged commit 6fc690f into AlekseyKorzun:master Mar 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment