Add '@' to the list of characters removed from radio/checkbox ID.

This character can easily show up in email addresses and can cause
invalid HTML.

Refs #2733
This commit is contained in:
mark_story 2014-02-02 21:20:31 -05:00
parent 405f3a1cb9
commit ecf5aec1ae

View file

@ -2083,7 +2083,7 @@ class FormHelper extends AppHelper {
*/ */
public function domIdSuffix($value, $type = 'html5') { public function domIdSuffix($value, $type = 'html5') {
if ($type === 'html5') { if ($type === 'html5') {
$value = str_replace(array('<', '>', ' ', '"', '\''), '_', $value); $value = str_replace(array('@', '<', '>', ' ', '"', '\''), '_', $value);
} else { } else {
$value = preg_replace('~[^\\pL\d-_]+~u', '_', $value); $value = preg_replace('~[^\\pL\d-_]+~u', '_', $value);
} }