Skip to content

Commit

Permalink
Merge pull request #55 from tjlytle/bugfix-html-contents
Browse files Browse the repository at this point in the history
Bugfix for HTML Element __toString()
  • Loading branch information
philsturgeon committed Jan 7, 2015
2 parents 2376df8 + 9776990 commit 8cc6e6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HtmlElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function __toString()
$result .= ' ' . $key . '="' . $value . '"';
}

if ($this->contents) {
if (!is_null($this->contents) and $this->contents != '') {
$result .= '>' . $this->getContents(true) . '</' . $this->tagName . '>';
} elseif ($this->selfClosing) {
$result .= ' />';
Expand Down

0 comments on commit 8cc6e6a

Please sign in to comment.