mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 05:09:06 +02:00
Merge pull request #8416 from lekoala/patch-14
raw2att accepts array, but sprintf doesn't
This commit is contained in:
commit
6a5fb4999c
@ -730,7 +730,11 @@ class FormField extends RequestHandler
|
||||
if ($value === true) {
|
||||
$parts[] = sprintf('%s="%s"', $name, $name);
|
||||
} else {
|
||||
$parts[] = sprintf('%s="%s"', $name, Convert::raw2att($value));
|
||||
$strValue = Convert::raw2att($value);
|
||||
if (!is_string($strValue)) {
|
||||
$strValue = json_encode($strValue);
|
||||
}
|
||||
$parts[] = sprintf('%s="%s"', $name, $strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user