diff --git a/src/View/Helper/HtmlHelper.php b/src/View/Helper/HtmlHelper.php index eb02e5a234e..86bfed58eeb 100644 --- a/src/View/Helper/HtmlHelper.php +++ b/src/View/Helper/HtmlHelper.php @@ -228,16 +228,16 @@ public function meta($type, $content = null, array $options = array()) { if (isset($types[$type])) { $type = $types[$type]; } elseif (!isset($options['type']) && $content !== null) { - if (is_array($content) && isset($content['ext'])) { - $type = $types[$content['ext']]; + if (is_array($content) && isset($content['_ext'])) { + $type = $types[$content['_ext']]; } else { - $type = $types['rss']; + $type = ['name' => $type, 'content' => $content]; } } elseif (isset($options['type']) && isset($types[$options['type']])) { $type = $types[$options['type']]; unset($options['type']); } else { - $type = array(); + $type = []; } $options += $type; diff --git a/tests/TestCase/View/Helper/HtmlHelperTest.php b/tests/TestCase/View/Helper/HtmlHelperTest.php index 181e16a69fb..7fce6226d30 100644 --- a/tests/TestCase/View/Helper/HtmlHelperTest.php +++ b/tests/TestCase/View/Helper/HtmlHelperTest.php @@ -1534,11 +1534,11 @@ public function testMeta() { $this->assertHtml($expected, $result); $result = $this->Html->meta('non-existing'); - $expected = array('assertHtml($expected, $result); - $result = $this->Html->meta('non-existing', '/posts.xpp'); - $expected = array('link' => array('href' => 'preg:/.*\/posts\.xpp/', 'type' => 'application/rss+xml', 'rel' => 'alternate', 'title' => 'non-existing')); + $result = $this->Html->meta('non-existing', 'some content'); + $expected = ['meta' => ['name' => 'non-existing', 'content' => 'some content']]; $this->assertHtml($expected, $result); $result = $this->Html->meta('non-existing', '/posts.xpp', array('type' => 'atom'));