From 43a122cc36a5d12f31758afc05e679bf39e842b7 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Thu, 11 May 2017 22:22:52 +1200 Subject: [PATCH] Fix for meta closing tags Prevent html errors when FormField::create_tag('meta') is called from $MetaTags() so ``` ``` becomes ``` ``` Add all void elements to list --- src/Forms/FormField.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Forms/FormField.php b/src/Forms/FormField.php index d7cf385cd..b9699be6c 100644 --- a/src/Forms/FormField.php +++ b/src/Forms/FormField.php @@ -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( '<%s%s>%s', $tag,