diff --git a/NEWS b/NEWS index 9acb78ef..7ae5b345 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +1.0.1, unknown release date +- Fixed slight bug in DOMLex attribute parsing + 1.0.0, released 2006-09-01 - Fixed broken numeric entity conversion - Malformed UTF-8 and non-SGML character detection and cleaning implemented diff --git a/library/HTMLPurifier/Lexer/DOMLex.php b/library/HTMLPurifier/Lexer/DOMLex.php index 1ba9675f..2df01f52 100644 --- a/library/HTMLPurifier/Lexer/DOMLex.php +++ b/library/HTMLPurifier/Lexer/DOMLex.php @@ -87,19 +87,20 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer return; } + $attr = $node->hasAttributes() ? + $this->transformAttrToAssoc($node->attributes) : + array(); + // We still have to make sure that the element actually IS empty if (!$node->childNodes->length) { if ($collect) { - $tokens[] = $this->factory->createEmpty( - $node->tagName, - $this->transformAttrToAssoc($node->attributes) - ); + $tokens[] = $this->factory->createEmpty($node->tagName, $attr); } } else { if ($collect) { // don't wrap on first iteration $tokens[] = $this->factory->createStart( $tag_name = $node->tagName, // somehow, it get's dropped - $this->transformAttrToAssoc($node->attributes) + $attr ); } foreach ($node->childNodes as $node) {