mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-08 15:11:51 +00:00
Fix bug in parsing single attribute with entities.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
parent
d3abcb90e3
commit
00c66fa9cb
2
NEWS
2
NEWS
@ -10,6 +10,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
==========================
|
==========================
|
||||||
|
|
||||||
4.1.1, unknown release date
|
4.1.1, unknown release date
|
||||||
|
- Fix bug in DirectLex for parsing elements with a single attribute
|
||||||
|
with entities.
|
||||||
- Rewrite CSS output logic for font-family and url(). Thanks Mario
|
- Rewrite CSS output logic for font-family and url(). Thanks Mario
|
||||||
Heiderich <mario.heiderich@googlemail.com> for reporting and Takeshi
|
Heiderich <mario.heiderich@googlemail.com> for reporting and Takeshi
|
||||||
Terada <t-terada@violet.plala.or.jp> for suggesting the fix.
|
Terada <t-terada@violet.plala.or.jp> for suggesting the fix.
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
</file>
|
</file>
|
||||||
<file name="HTMLPurifier/Lexer.php">
|
<file name="HTMLPurifier/Lexer.php">
|
||||||
<line>81</line>
|
<line>81</line>
|
||||||
|
<line>269</line>
|
||||||
</file>
|
</file>
|
||||||
<file name="HTMLPurifier/Lexer/DirectLex.php">
|
<file name="HTMLPurifier/Lexer/DirectLex.php">
|
||||||
<line>53</line>
|
<line>53</line>
|
||||||
|
@ -384,7 +384,7 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($value === false) $value = '';
|
if ($value === false) $value = '';
|
||||||
return array($key => $value);
|
return array($key => $this->parseData($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup loop environment
|
// setup loop environment
|
||||||
|
@ -262,6 +262,15 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_tokenizeHTML_singleAttribute() {
|
||||||
|
$this->assertTokenization(
|
||||||
|
'<br style="&" />',
|
||||||
|
array(
|
||||||
|
new HTMLPurifier_Token_Empty('br', array('style' => '&'))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function test_tokenizeHTML_emptyTag() {
|
function test_tokenizeHTML_emptyTag() {
|
||||||
$this->assertTokenization(
|
$this->assertTokenization(
|
||||||
'<br />',
|
'<br />',
|
||||||
|
Loading…
Reference in New Issue
Block a user