Open JonTJ opened 7 years ago
adding the following method to ..\Form\Element\Recaptcha fixes this issue:
public function filterName($value, $allowBrackets = false)
{
$charset = '^a-zA-Z0-9\-_\x7f-\xff';
if ($allowBrackets) {
$charset .= '\[\]';
}
return preg_replace('/[' . $charset . ']/', '', (string) $value);
}
Hi @JonTJ - thanks for the find and fix. Would you like to make a pull request? I can push this out once that is done.
Hi there
Im having trouble with hydration - isValid always returns false as it thinks the value is empty. Zend_Form_Element::filterName() filters out '-' characters when setting the element name, obviously this is an issue as Google renders the element on the page with the '-' characters (g-recaptcha-response becomes grecaptcharesponse). Is there a known work around for this short of extending the Zend_Form_Element class to include the '-' character in the list of allowed name characters?
Many thanks! Jon