Tiger_Validate_Recaptcha
@api· extendsZend_Validate_Abstract
Tiger_Validate_Recaptcha — server-side validation of a Google reCAPTCHA response.
A standard Zend_Validate you can attach to any element (or, via
Tiger_Form_Element_Recaptcha, get automatically). It reads the widget's token from
the form context (the widget always posts the fixed field g-recaptcha-response),
verifies it with Google (Tiger_Recaptcha::verify), and — for v3 — enforces the score
threshold and, optionally, the expected action.
When reCAPTCHA is disabled in config it passes through, so forms validate normally in dev without keys. See Tiger_Recaptcha for the fail-open-on-outage policy.
Methods
__construct()
__construct($options = null)
Build the validator, optionally binding an expected v3 action.
$optionsarray|Zend_Config|null— optional config; anactionkey sets the expected v3 action
isValid()
isValid($value, $context = null)
Verify the reCAPTCHA token from the form context (pass-through when disabled).
$valuemixed— the element value (usually empty — the real token is in context)$contextarray— the full form data, carryingg-recaptcha-response
Returns bool — true when reCAPTCHA is disabled, the outage policy fails open, or verification passes