1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-12 00:54:48 +02:00

Finish implementing fixNesting(). Removed security-in-depth check for optimization reasons, since the info array will never cause such a condition.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@58 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-07-20 00:30:35 +00:00
parent 3e6bcb7a0f
commit ff8f24458d
3 changed files with 84 additions and 14 deletions

View File

@@ -413,14 +413,29 @@ class Test_PureHTMLDefinition extends UnitTestCase
new MF_EndTag('b'),
);
// need test of empty set that's required, resulting in removal of node
// test of empty set that's required, resulting in removal of node
$inputs[3] = array(
new MF_StartTag('ul'),
new MF_EndTag('ul')
);
$expect[3] = array();
// need test of cascading removal (if possible)
// ! cover all child element conditions
// execute only one test at a time:
$inputs = array( $inputs[0] );
// test illegal text which gets removed
$inputs[4] = array(
new MF_StartTag('ul'),
new MF_Text('Illegal Text'),
new MF_StartTag('li'),
new MF_Text('Legal item'),
new MF_EndTag('li'),
new MF_EndTag('ul')
);
$expect[4] = array(
new MF_StartTag('ul'),
new MF_StartTag('li'),
new MF_Text('Legal item'),
new MF_EndTag('li'),
new MF_EndTag('ul')
);
foreach ($inputs as $i => $input) {
$result = $this->def->fixNesting($input);