NEWS ( CHANGELOG and HISTORY ) HTMLPurifier ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| = KEY ==================== # Breaks back-compat ! Feature - Bugfix + Sub-comment . Internal change ========================== ERRATA - PH5P is seriously broken here; it can result in fatal errors and exceptions. If you desire to use it, please use it with the latest, PHP5-only version of HTML Purifier. 2.1.5, released 2008-06-19 ! More robust imagecrash protection with height/width CSS with %CSS.MaxImgLength, and height/width HTML with %HTML.MaxImgLength. - AttrValidator operations are now atomic; updates to attributes are not manifest in token until end of operations. This prevents naughty internal code from directly modifying CurrentToken when they're not supposed to. - Percent encoding checks enabled for URI query and fragment - Disable percent height/width attributes for img - Fix stray backslashes in font-family; CSS Unicode character escapes are now properly resolved (although *only* in font-family). - Improve parseCDATA algorithm to take into account newline normalization - Account for browser confusion between Yen character and backslash in Shift_JIS encoding. This fix generalizes to any other encoding which is not a strict superset of printable ASCII. - Improved adherence to Unicode by checking for non-character codepoints. Thanks Geoffrey Sneddon for reporting. This may result in degraded performance for extremely large inputs. - Allow CSS property-value pair ''text-decoration: none'' . Added HTMLPurifier_UnitConverter and HTMLPurifier_Length for convenient handling of CSS-style lengths. HTMLPurifier_AttrDef_CSS_Length now uses this class. . API of HTMLPurifier_AttrDef_CSS_Length changed from __construct($disable_negative) to __construct($min, $max). __construct(true) is equivalent to __construct('0'). (replace __construct with HTMLPurifier_AttrDef_CSS_Length) . Added HTMLPurifier_AttrDef_Switch class . Rename HTMLPurifier_HTMLModule_Tidy->construct() to setup() and bubble method up inheritance hierarchy to HTMLPurifier_HTMLModule. All HTMLModules get this called with the configuration object. All modules now use this rather than __construct(), although legacy code using constructors will still work--the new format, however, lets modules access the configuration object for HTML namespace dependant tweaks. . AttrDef_HTML_Pixels now takes a single construction parameter, pixels. 2.1.4, released 2008-05-18 ! DefinitionCacheFactory now can register new implementations ! CSS properties are now case-insensitive ! Encoder optimized with valid UTF-8 input ! HTML Purifier's URI handling is a lot more robust, with much stricter validation checks and better percent encoding handling. - Colors missing # but in hex form will be corrected - CSS Number algorithm improved - Autoclose now operates iteratively, i.e.
now has both span tags closed. - Fix bug with trusted script handling in libxml versions later than 2.6.28. - Fix bug in comment parsing with DirectLex - Fix bug with rgb(0, 1, 2) color syntax with spaces inside shorthand syntax - HTMLPurifier_HTMLDefinition->addAttribute can now be called multiple times on the same element without emitting errors. - Iconv uses set_error_handler instead of shut-up operator - Add protection against imagecrash attack with CSS height/width - HTMLPurifier::getInstance() renamed to HTMLPurifier::instance() for consistency - Fixed bug with fallback languages in LanguageFactory 2.1.3, released 2007-11-05 ! tests/multitest.php allows you to test multiple versions by running tests/index.php through multiple interpreters using `phpv` shell script (you must provide this script!) - Fixed poor include ordering for Email URI AttrDefs, causes fatal errors on some systems. - Injector algorithm further refined: off-by-one error regarding skip counts for dormant injectors fixed - Corrective blockquote definition now enabled for HTML 4.01 Strict - Fatal error when tag (or any other element with required attributes) has 'id' attribute fixed, thanks NykO18 for reporting - Fix warning emitted when a non-supported URI scheme is passed to the MakeAbsolute URIFilter, thanks NykO18 (again) - Further refine AutoParagraph injector. Behavior inside of elements allowing paragraph tags clarified: only inline content delimeted by double newlines (not block elements) are paragraphed. - Buggy treatment of end tags of elements that have required attributes fixed (does not manifest on default tag-set) - Spurious internal content reorganization error suppressed - HTMLDefinition->addElement now returns a reference to the created element object, as implied by the documentation - Phorum mod's HTML Purifier help message expanded (unreleased elsewhere) - Fix a theoretical class of infinite loops from DirectLex reported by Nate Abele - Work around unnecessary DOMElement type-cast in PH5P that caused errors in PHP 5.1 - Work around PHP 4 SimpleTest lack-of-error complaining for one-time-only HTMLDefinition errors, this may indicate problems with error-collecting facilities in PHP 5 - Make ErrorCollectorEMock work in both PHP 4 and PHP 5 - Make PH5P work with PHP 5.0 by removing unnecessary array parameter typedef . %Core.AcceptFullDocuments renamed to %Core.ConvertDocumentToFragment to better communicate its purpose . Error unit tests can now specify the expectation of no errors. Future iterations of the harness will be extremely strict about what errors are allowed . Extend Injector hooks to allow for more powerful injector routines . HTMLDefinition->addBlankElement created, as according to the HTMLModule method . Doxygen configuration file updated, with minor improvements . Test runner now checks for similarly named files in conf/ directory too. . Minor cosmetic change to flush-definition-cache.php: trailing newline is outputted . Maintenance script for generating PH5P patch added, original PH5P source file also added under version control . Full unit test runner script title made more descriptive with PHP version . Updated INSTALL file to state that 4.3.7 is the earliest version we are actively testing 2.1.2, released 2007-09-03 ! Implemented Object module for trusted users ! Implemented experimental HTML5 parsing mode using PH5P. To use, add this to your code: require_once 'HTMLPurifier/Lexer/PH5P.php'; $config->set('Core', 'LexerImpl', 'PH5P'); Note that this Lexer introduces some classes not in the HTMLPurifier namespace. Also, this is PHP5 only. ! CSS property border-spacing implemented - Fix non-visible parsing error in DirectLex with empty tags that have slashes inside attribute values. - Fix typo in CSS definition: border-collapse:seperate; was incorrectly accepted as valid CSS. Usually non-visible, because this styling is the default for tables in most browsers. Thanks Brett Zamir for pointing this out. - Fix validation errors in configuration form - Hammer out a bunch of edge-case bugs in the standalone distribution - Inclusion reflection removed from URISchemeRegistry; you must manually include any new schema files you wish to use - Numerous typo fixes in documentation thanks to Brett Zamir . Unit test refactoring for one logical test per test function . Config and context parameters in ComplexHarness deprecated: instead, edit the $config and $context member variables . HTML wrapper in DOMLex now takes DTD identifiers into account; doesn't really make a difference, but is good for completeness sake . merge-library.php script refactored for greater code reusability and PHP4 compatibility 2.1.1, released 2007-08-04 - Fix show-stopper bug in %URI.MakeAbsolute functionality - Fix PHP4 syntax error in standalone version . Add prefix directory to include path for standalone, this prevents other installations from clobbering the standalone's URI schemes . Single test methods can be invoked by prefixing with __only 2.1.0, released 2007-08-02 # flush-htmldefinition-cache.php superseded in favor of a generic flush-definition-cache.php script, you can clear a specific cache by passing its name as a parameter to the script ! Phorum mod implemented for HTML Purifier ! With %Core.AggressivelyFixLt, <3 and similar emoticons no longer trigger HTML removal in PHP5 (DOMLex). This directive is not necessary for PHP4 (DirectLex). ! Standalone file now available, which greatly reduces the amount of includes (although there are still a few files that reside in the standalone folder) ! Relative URIs can now be transformed into their absolute equivalents using %URI.Base and %URI.MakeAbsolute ! Ruby implemented for XHTML 1.1 ! You can now define custom URI filtering behavior, see enduser-uri-filter.html for more details ! UTF-8 font names now supported in CSS - AutoFormatters emit friendly error messages if tags or attributes they need are not allowed - ConfigForm's compactification of directive names is now configurable - AutoParagraph autoformatter algorithm refined after field-testing - XHTML 1.1 now applies XHTML 1.0 Strict cleanup routines, namely blockquote wrapping - Contents of