diff --git a/NEWS b/NEWS index 7d1cac0a..6f2f3acc 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier performed on it, ensuring that its internal state stays consistent. To revert this behavior, you can set the $autoFinalize member variable off, but it's not recommended. +- Deprecated and removed EnableRedundantUTF8Cleaning. It didn't even work! . Unit test for ElementDef created, ElementDef behavior modified to be more flexible . Added convenience functions for HTMLModule constructors diff --git a/library/HTMLPurifier.php b/library/HTMLPurifier.php index 3d538bca..dfd252f1 100644 --- a/library/HTMLPurifier.php +++ b/library/HTMLPurifier.php @@ -42,7 +42,7 @@ // almost every class has an undocumented dependency to these, so make sure // they get included -require_once 'HTMLPurifier/ConfigSchema.php'; +require_once 'HTMLPurifier/ConfigSchema.php'; // important require_once 'HTMLPurifier/Config.php'; require_once 'HTMLPurifier/Context.php'; diff --git a/library/HTMLPurifier/AttrCollections.php b/library/HTMLPurifier/AttrCollections.php index 9e056626..da5445db 100644 --- a/library/HTMLPurifier/AttrCollections.php +++ b/library/HTMLPurifier/AttrCollections.php @@ -1,7 +1,6 @@ child = false; } if(!is_null($def->child)) $this->child = $def->child; - if(!is_null($def->descendants_are_inline)) $this->descendants_are_inline = $def->descendants_are_inline; + if($def->descendants_are_inline) $this->descendants_are_inline = $def->descendants_are_inline; if(!is_null($def->safe)) $this->safe = $def->safe; } diff --git a/library/HTMLPurifier/Encoder.php b/library/HTMLPurifier/Encoder.php index 1a22b452..cddcdb40 100644 --- a/library/HTMLPurifier/Encoder.php +++ b/library/HTMLPurifier/Encoder.php @@ -1,7 +1,5 @@ _clean_utf8 = $config->get('Output', 'EnableRedundantUTF8Cleaning'); $this->_scriptFix = $config->get('Output', 'CommentScriptContents'); $doctype = $config->getDoctype(); @@ -204,7 +183,6 @@ class HTMLPurifier_Generator * @return String escaped data. */ function escape($string) { - if ($this->_clean_utf8) $string = HTMLPurifier_Lexer::cleanUTF8($string); return htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); } diff --git a/library/HTMLPurifier/Strategy/FixNesting.php b/library/HTMLPurifier/Strategy/FixNesting.php index 08f90756..bed1818a 100644 --- a/library/HTMLPurifier/Strategy/FixNesting.php +++ b/library/HTMLPurifier/Strategy/FixNesting.php @@ -49,7 +49,7 @@ class HTMLPurifier_Strategy_FixNesting extends HTMLPurifier_Strategy $tokens[] = new HTMLPurifier_Token_End($parent_name); // setup the context variables - $is_inline = false; // reference var that we alter + $is_inline = $definition->info_parent_def->descendants_are_inline; $context->register('IsInline', $is_inline); //####################################################################// diff --git a/tests/HTMLPurifier/ElementDefTest.php b/tests/HTMLPurifier/ElementDefTest.php index 6ac7b521..23ef6e17 100644 --- a/tests/HTMLPurifier/ElementDefTest.php +++ b/tests/HTMLPurifier/ElementDefTest.php @@ -37,7 +37,7 @@ class HTMLPurifier_ElementDefTest extends UnitTestCase 'old' => true, 'removed-old' => true ); - $def1->descendants_are_inline = $overloaded_old; + $def1->descendants_are_inline = false; $def1->excludes = array( 'old' => true, 'removed-old' => true @@ -64,7 +64,7 @@ class HTMLPurifier_ElementDefTest extends UnitTestCase 'new' => true, 'removed-old' => false ); - $def2->descendants_are_inline = $overloaded_new; + $def2->descendants_are_inline = true; $def2->excludes = array( 'new' => true, 'removed-old' => false @@ -94,7 +94,7 @@ class HTMLPurifier_ElementDefTest extends UnitTestCase 'old' => true, 'new' => true )); - $this->assertIdentical($def1->descendants_are_inline, $overloaded_new); + $this->assertIdentical($def1->descendants_are_inline, true); $this->assertIdentical($def1->excludes, array( 'old' => true, 'new' => true