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:
Ralph Slooten 2017-05-11 22:22:52 +12:00 committed by axllent
parent 0b70b008b3
commit 43a122cc36

View File

@ -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,