Skip to content
Permalink
Browse files

changed HtmlHelper::tag() just return $text when empty($name)

  • Loading branch information...
openam committed May 20, 2013
1 parent 12462b2 commit 0d082b599aff352ba5328b64d0acb800fdc0d24c
Showing with 7 additions and 1 deletion.
  1. +6 −0 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  2. +1 −1 lib/Cake/View/Helper/HtmlHelper.php
@@ -1697,6 +1697,12 @@ public function testTag() {
$result = $this->Html->tag(false, '<em>stuff</em>');
$this->assertEquals($result, '<em>stuff</em>');
$result = $this->Html->tag(null, '<em>stuff</em>');
$this->assertEquals($result, '<em>stuff</em>');
$result = $this->Html->tag('', '<em>stuff</em>');
$this->assertEquals($result, '<em>stuff</em>');
}
/**
@@ -896,7 +896,7 @@ public function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $
* @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) {
if (empty($name)) {
return $text;
}
if (is_array($options) && isset($options['escape']) && $options['escape']) {

0 comments on commit 0d082b5

Please sign in to comment.
You can’t perform that action at this time.