1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

Don't truncate in DOMLex when seeing closing div

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
This commit is contained in:
Edward Z. Yang
2014-08-31 08:50:33 +01:00
parent 80ebd4322e
commit 15d1a3003a
4 changed files with 24 additions and 6 deletions

View File

@@ -264,7 +264,8 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness
new HTMLPurifier_Token_End('poolasdf'),
new HTMLPurifier_Token_End('pooloka'),
),
'PH5P' => $alt,
// 20140831: Weird, but whatever...
'PH5P' => array(new HTMLPurifier_Token_Empty('asdf')),
)
);
}
@@ -800,6 +801,21 @@ div {}
);
}
public function test_tokenizeHTML_prematureDivClose()
{
$this->assertTokenization(
'</div>dontdie',
array(
new HTMLPurifier_Token_End('div'),
new HTMLPurifier_Token_Text('dontdie')
),
array(
'DOMLex' => $alt = array(new HTMLPurifier_Token_Text('dontdie')),
'PH5P' => $alt
)
);
}
/*