Merge pull request #8416 from lekoala/patch-14

raw2att accepts array, but sprintf doesn't
This commit is contained in:
Robbie Averill 2018-10-03 13:21:43 +02:00 committed by GitHub
commit 6a5fb4999c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
}