mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +00:00
[3.1.0] [BACKPORT] Fix <span><span><div> by sending back to the front of the loop for reprocessing.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1492 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
4e32902c63
commit
57f897661e
4
NEWS
4
NEWS
@ -9,6 +9,10 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
. Internal change
|
. Internal change
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
3.0.1, unknown release date
|
||||||
|
- Autoclose now operates iteratively, i.e. <span><span><div> now has
|
||||||
|
both span tags closed.
|
||||||
|
|
||||||
3.0.0, released 2008-01-06
|
3.0.0, released 2008-01-06
|
||||||
# HTML Purifier is PHP 5 only! The 2.1.x branch will be maintained
|
# HTML Purifier is PHP 5 only! The 2.1.x branch will be maintained
|
||||||
until PHP 4 is completely deprecated, but no new features will be added
|
until PHP 4 is completely deprecated, but no new features will be added
|
||||||
|
@ -156,10 +156,9 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
|
|||||||
// the parent
|
// the parent
|
||||||
if (!isset($parent_info->child->elements[$token->name])) {
|
if (!isset($parent_info->child->elements[$token->name])) {
|
||||||
if ($e) $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', $parent);
|
if ($e) $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', $parent);
|
||||||
// close the parent, then append the token
|
// close the parent, then re-loop to reprocess token
|
||||||
$result[] = new HTMLPurifier_Token_End($parent->name);
|
$result[] = new HTMLPurifier_Token_End($parent->name);
|
||||||
$result[] = $token;
|
$this->inputIndex--;
|
||||||
$this->currentNesting[] = $token;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,5 +82,12 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testAutoCloseMultiple() {
|
||||||
|
$this->assertResult(
|
||||||
|
'<span><span><div></div>',
|
||||||
|
'<span><span></span></span><div></div>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user