@@ 400-414 (lines=15) @@ | ||
397 | } |
|
398 | ||
399 | // make sure that we have something open |
|
400 | if (empty($this->stack)) { |
|
401 | if ($escape_invalid_tags) { |
|
402 | if ($e) { |
|
403 | $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag to text'); |
|
404 | } |
|
405 | $token = new HTMLPurifier_Token_Text($generator->generateFromToken($token)); |
|
406 | } else { |
|
407 | if ($e) { |
|
408 | $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag removed'); |
|
409 | } |
|
410 | $token = $this->remove(); |
|
411 | } |
|
412 | $reprocess = true; |
|
413 | continue; |
|
414 | } |
|
415 | ||
416 | // first, check for the simplest case: everything closes neatly. |
|
417 | // Eventually, everything passes through here; if there are problems |
|
@@ 458-472 (lines=15) @@ | ||
455 | } |
|
456 | ||
457 | // we didn't find the tag, so remove |
|
458 | if ($skipped_tags === false) { |
|
459 | if ($escape_invalid_tags) { |
|
460 | if ($e) { |
|
461 | $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag to text'); |
|
462 | } |
|
463 | $token = new HTMLPurifier_Token_Text($generator->generateFromToken($token)); |
|
464 | } else { |
|
465 | if ($e) { |
|
466 | $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag removed'); |
|
467 | } |
|
468 | $token = $this->remove(); |
|
469 | } |
|
470 | $reprocess = true; |
|
471 | continue; |
|
472 | } |
|
473 | ||
474 | // do errors, in REVERSE $j order: a,b,c with </a></b></c> |
|
475 | $c = count($skipped_tags); |