mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-08 23:26:39 +02:00
Use a Zipper to process MakeWellFormed, removing quadratic behavior.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
@@ -307,13 +307,13 @@ class HTMLPurifier_Injector_AutoParagraph extends HTMLPurifier_Injector
|
||||
*/
|
||||
private function _pLookAhead()
|
||||
{
|
||||
$this->current($i, $current);
|
||||
if ($current instanceof HTMLPurifier_Token_Start) {
|
||||
if ($this->currentToken instanceof HTMLPurifier_Token_Start) {
|
||||
$nesting = 1;
|
||||
} else {
|
||||
$nesting = 0;
|
||||
}
|
||||
$ok = false;
|
||||
$i = null;
|
||||
while ($this->forwardUntilEndToken($i, $current, $nesting)) {
|
||||
$result = $this->_checkNeedsP($current);
|
||||
if ($result !== null) {
|
||||
|
Reference in New Issue
Block a user