diff --git a/composer.json b/composer.json index b0db660..95ebd7b 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": ">=5.3", - "ezyang/htmlpurifier": "^4.8" + "ezyang/htmlpurifier": "^4.19" }, "require-dev": { "phpunit/phpunit": ">=4.7 <10.0", diff --git a/library/HTMLPurifier/Lexer/HTML5.php b/library/HTMLPurifier/Lexer/HTML5.php index a558040..50fe18d 100644 --- a/library/HTMLPurifier/Lexer/HTML5.php +++ b/library/HTMLPurifier/Lexer/HTML5.php @@ -57,16 +57,7 @@ public function tokenizeHTML($html, $config, $context) protected function armor($html, HTMLPurifier_Config $config) { if ($config->get('Core.AggressivelyFixLt')) { - $char = '[^a-z!\/]'; - $comment = "/|\z)/is"; - $html = preg_replace_callback($comment, array($this, 'callbackArmorCommentEntities'), $html); - - do { - $old = $html; - $html = preg_replace("/<($char)/i", '<\\1', $html); - } while ($html !== $old); - - $html = preg_replace_callback($comment, array($this, 'callbackUndoCommentSubst'), $html); // fix comments + $html = $this->aggressivelyFixLt($html); } return $html;