diff --git a/library/HTMLPurifier/Lexer.php b/library/HTMLPurifier/Lexer.php index 1f004ea9..1dd984b6 100644 --- a/library/HTMLPurifier/Lexer.php +++ b/library/HTMLPurifier/Lexer.php @@ -295,10 +295,9 @@ class HTMLPurifier_Lexer /** * Takes a string of HTML (fragment or document) and returns the content */ - function extractBody($html, $return_bool = false) { + function extractBody($html) { $matches = array(); $result = preg_match('!]*>(.+?)!is', $html, $matches); - if ($return_bool) return $result; if ($result) { return $matches[1]; } else { diff --git a/library/HTMLPurifier/Lexer/DOMLex.php b/library/HTMLPurifier/Lexer/DOMLex.php index 9def5257..230e694e 100644 --- a/library/HTMLPurifier/Lexer/DOMLex.php +++ b/library/HTMLPurifier/Lexer/DOMLex.php @@ -37,7 +37,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer if (!$config) $config = HTMLPurifier_Config::createDefault(); if ($config->get('Core', 'AcceptFullDocuments')) { - $is_full = $this->extractBody($string, true); + $string = $this->extractBody($string); } $doc = new DOMDocument(); @@ -55,9 +55,8 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer // clean it into well-formed UTF-8 string $string = $this->cleanUTF8($string); - if (!$is_full) { // preprocess string, essential for UTF-8 - $string = + $string = ''. @@ -65,7 +64,6 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer ''. '
'.$string.'
'; - } @$doc->loadHTML($string); // mute all errors, handle it transparently