mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix for meta closing tags
Prevent html errors when FormField::create_tag('meta') is called from $MetaTags() so ``` <meta name="generator" content="SilverStripe - http://silverstripe.org"></meta> ``` becomes ``` <meta name="generator" content="SilverStripe - http://silverstripe.org" /> ``` Add all void elements to list
This commit is contained in:
parent
0b70b008b3
commit
43a122cc36
@ -333,7 +333,13 @@ class FormField extends RequestHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($content || $tag != 'input') {
|
if (
|
||||||
|
$content ||
|
||||||
|
!in_array($tag, array(
|
||||||
|
'area', 'base', 'br', 'col', 'embed', 'hr', 'img',
|
||||||
|
'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'
|
||||||
|
))
|
||||||
|
) {
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<%s%s>%s</%s>',
|
'<%s%s>%s</%s>',
|
||||||
$tag,
|
$tag,
|
||||||
|
Loading…
Reference in New Issue
Block a user