I'm wondering about the code a little:

$result is an empty hash, and so if there's no request parameter
the "else" is going to get an empty hash, but $result->{is_valid}
and $result->{error} are used in that else block:

    my $result = {};
    if ( $c->req->param( 'recaptcha_response_field' ) ) {
        $result = $cap->check_answer(
            $c->config->{recaptcha}->{priv_key}, $ENV{'REMOTE_ADDR'},
            $c->req->param('recaptcha_challenge_field'),
            $c->req->param('recaptcha_response_field')
        );
    }
    else {
        $c->stash->{recaptcha_ok} = $result->{is_valid};
        $c->stash->{recaptcha_error} = $result->{error} || "User appears not to 
have submitted a recaptcha";
    }

Then this doesn't look correct, either.

    if ( $result->{is_valid} ) {
        $c->stash->{recaptcha_ok} = 1;
    }
    else {
        $c->stash->{recaptcha_ok} = $result->{error};
    }


I'll be happy to send a patch if you like.



-- 
Bill Moseley
[EMAIL PROTECTED]


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to