diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php index 316c61838..36500dcd1 100644 --- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php @@ -1694,6 +1694,9 @@ class HtmlHelperTest extends CakeTestCase { $result = $this->Html->tag('div', '', array('class' => 'class-name', 'escape' => true)); $this->assertTags($result, array('div' => array('class' => 'class-name'), '<text>', '/div')); + + $result = $this->Html->tag(false, 'stuff'); + $this->assertEquals($result, 'stuff'); } /** diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index 80d7e8221..b61e5ba20 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -896,6 +896,9 @@ class HtmlHelper extends AppHelper { * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::tag */ public function tag($name, $text = null, $options = array()) { + if ($name === false) { + return $text; + } if (is_array($options) && isset($options['escape']) && $options['escape']) { $text = h($text); unset($options['escape']);