Skip to content

Commit

Permalink
Merge pull request #1 from zero-24/patch-10
Browse files Browse the repository at this point in the history
hopfully fix travis.
  • Loading branch information
Dekari committed Sep 24, 2015
2 parents d228d56 + e284348 commit d538a29
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions plugins/captcha/recaptcha/recaptcha.php
Expand Up @@ -118,26 +118,34 @@ public function onCheckAnswer($code = null)
{
case '1.0':
$challenge = $input->get('recaptcha_challenge_field', '', 'string');

//We check the override $code param
if (!empty($code))
$response = $code;
else
$response = $input->get('recaptcha_response_field', '', 'string');

$spam = ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0);
// We check the override $code param
if (!empty($code))
{
$response = $code;
}
else
{
$response = $input->get('recaptcha_response_field', '', 'string');
}

$spam = ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0);
break;
case '2.0':
// Challenge Not needed in 2.0 but needed for getResponse call
$challenge = null;

//We check the override $code param
if (!empty($code))
$response = $code;
else
$response = $input->get('g-recaptcha-response', '', 'string');
// We check the override $code param
if (!empty($code))
{
$response = $code;
}
else
{
$response = $input->get('g-recaptcha-response', '', 'string');
}

$spam = ($response == null || strlen($response) == 0);
$spam = ($response == null || strlen($response) == 0);
break;
}

Expand Down

0 comments on commit d538a29

Please sign in to comment.