1 NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
2 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 = KEY ====================
10 ==========================
12 4.0.0, unknown release date
13 # APIs for ConfigSchema subsystem have substantially changed. See
14 docs/dev-config-bcbreaks.txt for details; in essence, anything that
15 had both namespace and directive now have a single unified key.
16 # Some configuration directives were renamed, specifically:
17 %AutoFormatParam.PurifierLinkifyDocURL -> %AutoFormat.PurifierLinkify.DocURL
18 %FilterParam.ExtractStyleBlocksEscaping -> %Filter.ExtractStyleBlocks.Escaping
19 %FilterParam.ExtractStyleBlocksScope -> %Filter.ExtractStyleBlocks.Scope
20 %FilterParam.ExtractStyleBlocksTidyImpl -> %Filter.ExtractStyleBlocks.TidyImpl
21 As usual, the old directive names will still work, but will throw E_NOTICE
23 # The allowed values for class have been relaxed to allow all of CDATA for
24 doctypes that are not XHTML 1.1 or XHTML 2.0. For old behavior, set
25 %Attr.ClassUseCDATA to false.
26 # Instead of appending the content model to an old content model, a blank
27 element will replace the old content model. You can use #SUPER to get
28 the old content model.
29 ! More robust support for name="" and id=""
30 ! HTMLPurifier_Config::inherit($config) allows you to inherit one
31 configuration, and have changes to that configuration be propagated
32 to all of its children.
33 ! Implement %HTML.Attr.Name.UseCDATA, which relaxes validation rules on
34 the name attribute when set. Use with care. Thanks Ian Cook for
36 ! Implement %AutoFormat.RemoveEmpty.RemoveNbsp, which removes empty
37 tags that contain non-breaking spaces as well other whitespace. You
38 can also modify which tags should have maintained with
39 %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.
40 ! Implement %Attr.AllowedClasses, which allows administrators to restrict
41 classes users can use to a specified finite set of classes, and
42 %Attr.ForbiddenClasses, which is the logical inverse.
43 ! You can now maintain your own configuration schema directories by
44 creating a config-schema.php file or passing an extra argument. Check
45 docs/dev-config-schema.html for more details.
46 ! Added HTMLPurifier_Config->serialize() method, which lets you save away
47 your configuration in a compact serial file, which you can unserialize
48 and use directly without having to go through the overhead of setup.
49 - Fix bug where URIDefinition would not get cleared if it's directives got
51 - Fix fatal error in HTMLPurifier_Encoder on certain platforms (probably NetBSD 5.0)
52 - Fix bug in Linkify autoformatter involving <a><span>http://foo</span></a>
53 - Make %URI.Munge not apply to links that have the same host as your host.
54 . Created script maintenance/rename-config.php for renaming a configuration
55 directive while maintaining its alias. This script does not change source code.
56 . Implement namespace locking for definition construction, to prevent
57 bugs where a directive is used for definition construction but is not
58 used to construct the cache hash.
60 3.3.0, released 2009-02-16
61 ! Implement CSS property 'overflow' when %CSS.AllowTricky is true.
62 ! Implement generic property list classess
63 - Fix bug with testEncodingSupportsASCII() algorithm when iconv() implementation
64 does not do the "right thing" with characters not supported in the output
66 - Spellcheck UTF-8: The Secret To Character Encoding
67 - Fix improper removal of the contents of elements with only whitespace. Thanks
68 Eric Wald for reporting.
69 - Fix broken test suite in versions of PHP without spl_autoload_register()
70 - Fix degenerate case with YouTube filter involving double hyphens.
71 Thanks Pierre Attar for reporting.
72 - Fix YouTube rendering problem on certain versions of Firefox.
73 - Fix CSSDefinition Printer problems with decorators
74 - Add text parameter to unit tests, forces text output
75 . Add verbose mode to command line test runner, use (--verbose)
76 . Turn on unit tests for UnitConverter
77 . Fix missing version number in configuration %Attr.DefaultImageAlt (added 3.2.0)
78 . Fix newline errors that caused spurious failures when CRLF HTML Purifier was
80 . Removed trailing whitespace from all text files, see
81 remote-trailing-whitespace.php maintenance script.
82 . Convert configuration to use property list backend.
84 3.2.0, released 2008-10-31
85 # Using %Core.CollectErrors forces line number/column tracking on, whereas
86 previously you could theoretically turn it off.
87 # HTMLPurifier_Injector->notifyEnd() is formally deprecated. Please
88 use handleEnd() instead.
89 ! %Output.AttrSort for when you need your attributes in alphabetical order to
90 deal with a bug in FCKEditor. Requested by frank farmer.
91 ! Enable HTML comments when %HTML.Trusted is on. Requested by Waldo Jaquith.
92 ! Proper support for name attribute. It is now allowed and equivalent to the id
93 attribute in a and img tags, and is only converted to id when %HTML.TidyLevel
94 is heavy (for all doctypes).
95 ! %AutoFormat.RemoveEmpty to remove some empty tags from documents. Please don't
96 use on hand-written HTML.
97 ! Add error-cases for unsupported elements in MakeWellFormed. This enables
98 the strategy to be used, standalone, on untrusted input.
99 ! %Core.AggressivelyFixLt is on by default. This causes more sensible
100 processing of left angled brackets in smileys and other whatnot.
101 ! Test scripts now have a 'type' parameter, which lets you say 'htmlpurifier',
102 'phpt', 'vtest', etc. in order to only execute those tests. This supercedes
103 the --only-phpt parameter, although for backwards-compatibility the flag
105 ! AutoParagraph auto-formatter will now preserve double-newlines upon output.
106 Users who are not performing inbound filtering, this may seem a little
107 useless, but as a bonus, the test suite and handling of edge cases is also
109 ! Experimental implementation of forms for %HTML.Trusted
110 ! Track column numbers when maintain line numbers is on
111 ! Proprietary 'background' attribute on table-related elements converted into
112 corresponding CSS. Thanks Fusemail for sponsoring this feature!
113 ! Add forward(), forwardUntilEndToken(), backward() and current() to Injector
115 ! HTMLPurifier_Injector->handleEnd() permits modification to end tokens. The
116 time of operation varies slightly from notifyEnd() as *all* end tokens are
117 processed by the injector before they are subject to the well-formedness rules.
118 ! %Attr.DefaultImageAlt allows overriding default behavior of setting alt to
119 basename of image when not present.
120 ! %AutoFormat.DisplayLinkURI neuters <a> tags into plain text URLs.
121 - Fix two bugs in %URI.MakeAbsolute; one involving empty paths in base URLs,
122 the other involving an undefined $is_folder error.
123 - Throw error when %Core.Encoding is set to a spurious value. Previously,
124 this errored silently and returned false.
125 - Redirected stderr to stdout for flush error output.
126 - %URI.DisableExternal will now use the host in %URI.Base if %URI.Host is not
128 - Do not re-munge URL if the output URL has the same host as the input URL.
130 - Fix error in documentation regarding %Filter.ExtractStyleBlocks
131 - Prevent <![CDATA[<body></body>]]> from triggering %Core.ConvertDocumentToFragment
132 - Fix bug with inline elements in blockquotes conflicting with strict doctype
133 - Detect if HTML support is disabled for DOM by checking for loadHTML() method.
134 - Fix bug where dots and double-dots in absolute URLs without hostname were
135 not collapsed by URIFilter_MakeAbsolute.
136 - Fix bug with anonymous modules operating on SafeEmbed or SafeObject elements
137 by reordering their addition.
138 - Will now throw exception on many error conditions during lexer creation; also
139 throw an exception when MaintainLineNumbers is true, but a non-tracksLineNumbers
141 - Detect if domxml extension is loaded, and use DirectLEx accordingly.
142 - Improve handling of big numbers with floating point arithmetic in UnitConverter.
143 Reported by David Morton.
144 . Strategy_MakeWellFormed now operates in-place, saving memory and allowing
145 for more interesting filter-backtracking
146 . New HTMLPurifier_Injector->rewind() functionality, allows injectors to rewind
147 index to reprocess tokens.
148 . StringHashParser now allows for multiline sections with "empty" content;
149 previously the section would remain undefined.
150 . Added --quick option to multitest.php, which tests only the most recent
151 release for each series.
152 . Added --distro option to multitest.php, which accepts either 'normal' or
153 'standalone'. This supercedes --exclude-normal and --exclude-standalone
155 3.1.1, released 2008-06-19
156 # %URI.Munge now, by default, does not munge resources (for example, <img src="">)
157 In order to enable this again, please set %URI.MungeResources to true.
158 ! More robust imagecrash protection with height/width CSS with %CSS.MaxImgLength,
159 and height/width HTML with %HTML.MaxImgLength.
160 ! %URI.MungeSecretKey for secure URI munging. Thanks Chris
161 for sponsoring this feature. Check out the corresponding documentation
162 for details. (Att Nightly testers: The API for this feature changed before
163 the general release. Namely, rename your directives %URI.SecureMungeSecretKey =>
164 %URI.MungeSecretKey and and %URI.SecureMunge => %URI.Munge)
165 ! Implemented post URI filtering. Set member variable $post to true to set
167 ! Allow modules to define injectors via $info_injector. Injectors are
168 automatically disabled if injector's needed elements are not found.
169 ! Support for "safe" objects added, use %HTML.SafeObject and %HTML.SafeEmbed.
170 Thanks Chris for sponsoring. If you've been using ad hoc code from the
171 forums, PLEASE use this instead.
172 ! Added substitutions for %e, %n, %a and %p in %URI.Munge (in order,
173 embedded, tag name, attribute name, CSS property name). See %URI.Munge
174 for more details. Requested by Jochem Blok.
175 - Disable percent height/width attributes for img.
176 - AttrValidator operations are now atomic; updates to attributes are not
177 manifest in token until end of operations. This prevents naughty internal
178 code from directly modifying CurrentToken when they're not supposed to.
179 This semantics change was requested by frank farmer.
180 - Percent encoding checks enabled for URI query and fragment
181 - Fix stray backslashes in font-family; CSS Unicode character escapes are
182 now properly resolved (although *only* in font-family). Thanks Takeshi Terada
184 - Improve parseCDATA algorithm to take into account newline normalization
185 - Account for browser confusion between Yen character and backslash in
186 Shift_JIS encoding. This fix generalizes to any other encoding which is not
187 a strict superset of printable ASCII. Thanks Takeshi Terada for reporting.
188 - Fix missing configuration parameter in Generator calls. Thanks vs for the
190 - Improved adherence to Unicode by checking for non-character codepoints.
191 Thanks Geoffrey Sneddon for reporting. This may result in degraded
192 performance for extremely large inputs.
193 - Allow CSS property-value pair ''text-decoration: none''. Thanks Jochem Blok
195 . Added HTMLPurifier_UnitConverter and HTMLPurifier_Length for convenient
196 handling of CSS-style lengths. HTMLPurifier_AttrDef_CSS_Length now uses
198 . API of HTMLPurifier_AttrDef_CSS_Length changed from __construct($disable_negative)
199 to __construct($min, $max). __construct(true) is equivalent to
201 . Added HTMLPurifier_AttrDef_Switch class
202 . Rename HTMLPurifier_HTMLModule_Tidy->construct() to setup() and bubble method
203 up inheritance hierarchy to HTMLPurifier_HTMLModule. All HTMLModules
204 get this called with the configuration object. All modules now
205 use this rather than __construct(), although legacy code using constructors
206 will still work--the new format, however, lets modules access the
207 configuration object for HTML namespace dependant tweaks.
208 . AttrDef_HTML_Pixels now takes a single construction parameter, pixels.
209 . ConfigSchema data-structure heavily optimized; on average it uses a third
210 the memory it did previously. The interface has changed accordingly,
211 consult changes to HTMLPurifier_Config for details.
212 . Variable parsing types now are magic integers instead of strings
213 . Added benchmark for ConfigSchema
214 . HTMLPurifier_Generator requires $config and $context parameters. If you
215 don't know what they should be, use HTMLPurifier_Config::createDefault()
216 and new HTMLPurifier_Context().
217 . Printers now properly distinguish between output configuration, and
218 target configuration. This is not applicable to scripts using
219 the Printers for HTML Purifier related tasks.
220 . HTML/CSS Printers must be primed with prepareGenerator($gen_config), otherwise
221 fatal errors will ensue.
222 . URIFilter->prepare can return false in order to abort loading of the filter
223 . Factory for AttrDef_URI implemented, URI#embedded to indicate URI that embeds
224 an external resource.
225 . %URI.Munge functionality factored out into a post-filter class.
226 . Added CurrentCSSProperty context variable during CSS validation
228 3.1.0, released 2008-05-18
229 # Unnecessary references to objects (vestiges of PHP4) removed from method
230 signatures. The following methods do not need references when assigning from
231 them and will result in E_STRICT errors if you try:
232 + HTMLPurifier_Config->get*Definition() [* = HTML, CSS]
233 + HTMLPurifier_ConfigSchema::instance()
234 + HTMLPurifier_DefinitionCacheFactory::instance()
235 + HTMLPurifier_DefinitionCacheFactory->create()
236 + HTMLPurifier_DoctypeRegistry->register()
237 + HTMLPurifier_DoctypeRegistry->get()
238 + HTMLPurifier_HTMLModule->addElement()
239 + HTMLPurifier_HTMLModule->addBlankElement()
240 + HTMLPurifier_LanguageFactory::instance()
241 # Printer_ConfigForm's get*() functions were static-ified
242 # %HTML.ForbiddenAttributes requires attribute declarations to be in the
243 form of tag@attr, NOT tag.attr (which will throw an error and won't do
244 anything). This is for forwards compatibility with XML; you'd do best
245 to migrate an %HTML.AllowedAttributes directives to this syntax too.
246 ! Allow index to be false for config from form creation
247 ! Added HTMLPurifier::VERSION constant
248 ! Commas, not dashes, used for serializer IDs. This change is forwards-compatible
249 and allows for version numbers like "3.1.0-dev".
250 ! %HTML.Allowed deals gracefully with whitespace anywhere, anytime!
251 ! HTML Purifier's URI handling is a lot more robust, with much stricter
252 validation checks and better percent encoding handling. Thanks Gareth Heyes
253 for indicating security vulnerabilities from lax percent encoding.
254 ! Bootstrap autoloader deals more robustly with classes that don't exist,
255 preventing class_exists($class, true) from barfing.
256 - InterchangeBuilder now alphabetizes its lists
257 - Validation error in configdoc output fixed
258 - Iconv and other encoding errors muted even with custom error handlers that
259 do not honor error_reporting
260 - Add protection against imagecrash attack with CSS height/width
261 - HTMLPurifier::instance() created for consistency, is equivalent to getInstance()
262 - Fixed and revamped broken ConfigForm smoketest
263 - Bug with bool/null fields in Printer_ConfigForm fixed
264 - Bug with global forbidden attributes fixed
265 - Improved error messages for allowed and forbidden HTML elements and attributes
266 - Missing (or null) in configdoc documentation restored
267 - If DOM throws and exception during parsing with PH5P (occurs in newer versions
268 of DOM), HTML Purifier punts to DirectLex
269 - Fatal error with unserialization of ScriptRequired
270 - Created directories are now chmod'ed properly
271 - Fixed bug with fallback languages in LanguageFactory
272 - Standalone testing setup properly with autoload
273 . Out-of-date documentation revised
274 . UTF-8 encoding check optimization as suggested by Diego
275 . HTMLPurifier_Error removed in favor of exceptions
276 . More copy() function removed; should use clone instead
277 . More extensive unit tests for HTMLDefinition
278 . assertPurification moved to central harness
279 . HTMLPurifier_Generator accepts $config and $context parameters during
280 instantiation, not runtime
281 . Double-quotes outside of attribute values are now unescaped
283 3.1.0rc1, released 2008-04-22
284 # Autoload support added. Internal require_once's removed in favor of an
285 explicit require list or autoloading. To use HTML Purifier,
286 you must now either use HTMLPurifier.auto.php
287 or HTMLPurifier.includes.php; setting the include path and including
288 HTMLPurifier.php is insufficient--in such cases include HTMLPurifier.autoload.php
289 as well to register our autoload handler (or modify your autoload function
290 to check HTMLPurifier_Bootstrap::getPath($class)). You can also use
291 HTMLPurifier.safe-includes.php for a less performance friendly but more
292 user-friendly library load.
293 # HTMLPurifier_ConfigSchema static functions are officially deprecated. Schema
294 information is stored in the ConfigSchema directory, and the
295 maintenance/generate-schema-cache.php generates the schema.ser file, which
296 is now instantiated. Support for userland schema changes coming soon!
297 # HTMLPurifier_Config will now throw E_USER_NOTICE when you use a directive
298 alias; to get rid of these errors just modify your configuration to use
299 the new directive name.
300 # HTMLPurifier->addFilter is deprecated; built-in filters can now be
301 enabled using %Filter.$filter_name or by setting your own filters using
303 # Directive-level safety properties superceded in favor of module-level
304 safety. Internal method HTMLModule->addElement() has changed, although
305 the externally visible HTMLDefinition->addElement has *not* changed.
306 ! Extra utility classes for testing and non-library operations can
307 be found in extras/. Specifically, these are FSTools and ConfigDoc.
308 You may find a use for these in your own project, but right now they
309 are highly experimental and volatile.
310 ! Integration with PHPT allows for automated smoketests
311 ! Limited support for proprietary HTML elements, namely <marquee>, sponsored
312 by Chris. You can enable them with %HTML.Proprietary if your client
314 ! Support for !important CSS cascade modifier. By default, this will be stripped
315 from CSS, but you can enable it using %CSS.AllowImportant
316 ! Support for display and visibility CSS properties added, set %CSS.AllowTricky
318 ! HTML Purifier now has its own Exception hierarchy under HTMLPurifier_Exception.
319 Developer error (not enduser error) can cause these to be triggered.
320 ! Experimental kses() wrapper introduced with HTMLPurifier.kses.php
321 ! Finally %CSS.AllowedProperties for tweaking allowed CSS properties without
322 mucking around with HTMLPurifier_CSSDefinition
323 ! ConfigDoc output has been enhanced with version and deprecation info.
324 ! %HTML.ForbiddenAttributes and %HTML.ForbiddenElements implemented.
325 - Autoclose now operates iteratively, i.e. <span><span><div> now has
326 both span tags closed.
327 - Various HTMLPurifier_Config convenience functions now accept another parameter
328 $schema which defines what HTMLPurifier_ConfigSchema to use besides the
330 - Fix bug with trusted script handling in libxml versions later than 2.6.28.
331 - Fix bug in ExtractStyleBlocks with comments in style tags
332 - Fix bug in comment parsing for DirectLex
333 - Flush output now displayed when in command line mode for unit tester
334 - Fix bug with rgb(0, 1, 2) color syntax with spaces inside shorthand syntax
335 - HTMLPurifier_HTMLDefinition->addAttribute can now be called multiple times
336 on the same element without emitting errors.
337 - Fixed fatal error in PH5P lexer with invalid tag names
338 . Plugins now get their own changelogs according to project conventions.
339 . Convert tokens to use instanceof, reducing memory footprint and
340 improving comparison speed.
341 . Dry runs now supported in SimpleTest; testing facilities improved
342 . Bootstrap class added for handling autoloading functionality
343 . Implemented recursive glob at FSTools->globr
344 . ConfigSchema now has instance methods for all corresponding define*
346 . A couple of new historical maintenance scripts were added.
347 . HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php split into two files
348 . tests/index.php can now be run from any directory.
349 . HTMLPurifier_Token subclasses split into seperate files
350 . HTMLPURIFIER_PREFIX now is defined in Bootstrap.php, NOT HTMLPurifier.php
351 . HTMLPURIFIER_PREFIX can now be defined outside of HTML Purifier
352 . New --php=php flag added, allows PHP executable to be specified (command
354 . htmlpurifier_add_test() preferred method to translate test files in to
355 classes, because it handles PHPT files too.
356 . Debugger class is deprecated and will be removed soon.
357 . Command line argument parsing for testing scripts revamped, now --opt value
359 . Smoketests now cleanup after magic quotes
360 . Generator now can output comments (however, comments are still stripped
361 from HTML Purifier output)
362 . HTMLPurifier_ConfigSchema->validate() deprecated in favor of
363 HTMLPurifier_VarParser->parse()
364 . Integers auto-cast into float type by VarParser.
365 . HTMLPURIFIER_STRICT removed; no validation is performed on runtime, only
366 during cache generation
367 . Reordered script calls in maintenance/flush.php
368 . Command line scripts now honor exit codes
369 . When --flush fails in unit testers, abort tests and print message
370 . Improved documentation in docs/dev-flush.html about the maintenance scripts
371 . copy() methods removed in favor of clone keyword
373 3.0.0, released 2008-01-06
374 # HTML Purifier is PHP 5 only! The 2.1.x branch will be maintained
375 until PHP 4 is completely deprecated, but no new features will be added
377 + Visibility declarations added
378 + Constructor methods renamed to __construct()
379 + PHP4 reference cruft removed (in progress)
380 ! CSS properties are now case-insensitive
381 ! DefinitionCacheFactory now can register new implementations
382 ! New HTMLPurifier_Filter_ExtractStyleBlocks for extracting <style> from
383 documents and cleaning their contents up. Requires the CSSTidy library
384 <http://csstidy.sourceforge.net/>. You can access the blocks with the
385 'StyleBlocks' Context variable ($purifier->context->get('StyleBlocks')).
386 The output CSS can also be "scoped" for a specific element, use:
387 %Filter.ExtractStyleBlocksScope
388 ! Experimental support for some proprietary CSS attributes allowed:
389 opacity (and all of the browser-specific equivalents) and scrollbar colors.
390 Enable by setting %CSS.Proprietary to true.
391 - Colors missing # but in hex form will be corrected
392 - CSS Number algorithm improved
393 - Unit testing and multi-testing now on steroids: command lines,
394 XML output, and other goodies now added.
395 . Unit tests for Injector improved
397 + HTMLPurifier_AttrDef_CSS_AlphaValue
398 + HTMLPurifier_AttrDef_CSS_Filter
399 . Multitest now has a file docblock
401 2.1.3, released 2007-11-05
402 ! tests/multitest.php allows you to test multiple versions by running
403 tests/index.php through multiple interpreters using `phpv` shell
404 script (you must provide this script!)
405 - Fixed poor include ordering for Email URI AttrDefs, causes fatal errors
407 - Injector algorithm further refined: off-by-one error regarding skip
408 counts for dormant injectors fixed
409 - Corrective blockquote definition now enabled for HTML 4.01 Strict
410 - Fatal error when <img> tag (or any other element with required attributes)
411 has 'id' attribute fixed, thanks NykO18 for reporting
412 - Fix warning emitted when a non-supported URI scheme is passed to the
413 MakeAbsolute URIFilter, thanks NykO18 (again)
414 - Further refine AutoParagraph injector. Behavior inside of elements
415 allowing paragraph tags clarified: only inline content delimeted by
416 double newlines (not block elements) are paragraphed.
417 - Buggy treatment of end tags of elements that have required attributes
418 fixed (does not manifest on default tag-set)
419 - Spurious internal content reorganization error suppressed
420 - HTMLDefinition->addElement now returns a reference to the created
421 element object, as implied by the documentation
422 - Phorum mod's HTML Purifier help message expanded (unreleased elsewhere)
423 - Fix a theoretical class of infinite loops from DirectLex reported
425 - Work around unnecessary DOMElement type-cast in PH5P that caused errors
427 - Work around PHP 4 SimpleTest lack-of-error complaining for one-time-only
428 HTMLDefinition errors, this may indicate problems with error-collecting
430 - Make ErrorCollectorEMock work in both PHP 4 and PHP 5
431 - Make PH5P work with PHP 5.0 by removing unnecessary array parameter typedef
432 . %Core.AcceptFullDocuments renamed to %Core.ConvertDocumentToFragment
433 to better communicate its purpose
434 . Error unit tests can now specify the expectation of no errors. Future
435 iterations of the harness will be extremely strict about what errors
437 . Extend Injector hooks to allow for more powerful injector routines
438 . HTMLDefinition->addBlankElement created, as according to the HTMLModule
440 . Doxygen configuration file updated, with minor improvements
441 . Test runner now checks for similarly named files in conf/ directory too.
442 . Minor cosmetic change to flush-definition-cache.php: trailing newline is
444 . Maintenance script for generating PH5P patch added, original PH5P source
445 file also added under version control
446 . Full unit test runner script title made more descriptive with PHP version
447 . Updated INSTALL file to state that 4.3.7 is the earliest version we
450 2.1.2, released 2007-09-03
451 ! Implemented Object module for trusted users
452 ! Implemented experimental HTML5 parsing mode using PH5P. To use, add
454 require_once 'HTMLPurifier/Lexer/PH5P.php';
455 $config->set('Core', 'LexerImpl', 'PH5P');
456 Note that this Lexer introduces some classes not in the HTMLPurifier
457 namespace. Also, this is PHP5 only.
458 ! CSS property border-spacing implemented
459 - Fix non-visible parsing error in DirectLex with empty tags that have
460 slashes inside attribute values.
461 - Fix typo in CSS definition: border-collapse:seperate; was incorrectly
462 accepted as valid CSS. Usually non-visible, because this styling is the
463 default for tables in most browsers. Thanks Brett Zamir for pointing
465 - Fix validation errors in configuration form
466 - Hammer out a bunch of edge-case bugs in the standalone distribution
467 - Inclusion reflection removed from URISchemeRegistry; you must manually
468 include any new schema files you wish to use
469 - Numerous typo fixes in documentation thanks to Brett Zamir
470 . Unit test refactoring for one logical test per test function
471 . Config and context parameters in ComplexHarness deprecated: instead, edit
472 the $config and $context member variables
473 . HTML wrapper in DOMLex now takes DTD identifiers into account; doesn't
474 really make a difference, but is good for completeness sake
475 . merge-library.php script refactored for greater code reusability and
478 2.1.1, released 2007-08-04
479 - Fix show-stopper bug in %URI.MakeAbsolute functionality
480 - Fix PHP4 syntax error in standalone version
481 . Add prefix directory to include path for standalone, this prevents
482 other installations from clobbering the standalone's URI schemes
483 . Single test methods can be invoked by prefixing with __only
485 2.1.0, released 2007-08-02
486 # flush-htmldefinition-cache.php superseded in favor of a generic
487 flush-definition-cache.php script, you can clear a specific cache
488 by passing its name as a parameter to the script
489 ! Phorum mod implemented for HTML Purifier
490 ! With %Core.AggressivelyFixLt, <3 and similar emoticons no longer
491 trigger HTML removal in PHP5 (DOMLex). This directive is not necessary
492 for PHP4 (DirectLex).
493 ! Standalone file now available, which greatly reduces the amount of
494 includes (although there are still a few files that reside in the
496 ! Relative URIs can now be transformed into their absolute equivalents
497 using %URI.Base and %URI.MakeAbsolute
498 ! Ruby implemented for XHTML 1.1
499 ! You can now define custom URI filtering behavior, see enduser-uri-filter.html
501 ! UTF-8 font names now supported in CSS
502 - AutoFormatters emit friendly error messages if tags or attributes they
504 - ConfigForm's compactification of directive names is now configurable
505 - AutoParagraph autoformatter algorithm refined after field-testing
506 - XHTML 1.1 now applies XHTML 1.0 Strict cleanup routines, namely
508 - Contents of <style> tags removed by default when tags are removed
509 . HTMLPurifier_Config->getSerial() implemented, this is extremely useful
510 for output cache invalidation
511 . ConfigForm printer now can retrieve CSS and JS files as strings, in
512 case HTML Purifier's directory is not publically accessible
513 . Introduce new text/itext configuration directive values: these represent
514 longer strings that would be more appropriately edited with a textarea
515 . Allow newlines to act as separators for lists, hashes, lookups and
517 . ConfigForm generates textareas instead of text inputs for lists, hashes,
518 lookups, text and itext fields
519 . Hidden element content removal genericized: %Core.HiddenElements can
520 be used to customize this behavior, by default <script> and <style> are
522 . Added HTMLPURIFIER_PREFIX constant, should be used instead of dirname(__FILE__)
523 . Custom ChildDef added to default include list
524 . URIScheme reflection improved: will not attempt to include file if class
525 already exists. May clobber autoload, so I need to keep an eye on it
526 . ConfigSchema heavily optimized, will only collect information and validate
527 definitions when HTMLPURIFIER_SCHEMA_STRICT is true.
528 . AttrDef_URI unit tests and implementation refactored
529 . benchmarks/ directory now protected from public view with .htaccess file;
530 run the tests via command line
531 . URI scheme is munged off if there is no authority and the scheme is the
533 . All unit tests inherit from HTMLPurifier_Harness, not UnitTestCase
534 . Interface for URIScheme changed
535 . Generic URI object to hold components of URI added, most systems involved
536 in URI validation have been migrated to use it
537 . Custom filtering for URIs factored out to URIDefinition interface for
538 maximum extensibility
540 2.0.1, released 2007-06-27
541 ! Tag auto-closing now based on a ChildDef heuristic rather than a
542 manually set auto_close array; some behavior may change
543 ! Experimental AutoFormat functionality added: auto-paragraph and
544 linkify your HTML input by setting %AutoFormat.AutoParagraph and
545 %AutoFormat.Linkify to true
546 ! Newlines normalized internally, and then converted back to the
547 value of PHP_EOL. If this is not desired, set your newline format
548 using %Output.Newline.
549 ! Beta error collection, messages are implemented for the most generic
550 cases involving Lexing or Strategies
551 - Clean up special case code for <script> tags
552 - Reorder includes for DefinitionCache decorators, fixes a possible
554 - Fixed bug where manually modified definitions were not saved via cache
555 (mostly harmless, except for the fact that it would be a little slower)
556 - Configuration objects with different serials do not clobber each
557 others when revision numbers are unequal
558 - Improve Serializer DefinitionCache directory permissions checks
559 - DefinitionCache no longer throws errors when it encounters old
560 serial files that do not conform to the current style
561 - Stray xmlns attributes removed from configuration documentation
562 - configForm.php smoketest no longer has XSS vulnerability due to
563 unescaped print_r output
564 - Printer adheres to configuration's directives on output format
565 - Fix improperly named form field in ConfigForm printer
566 . Rewire some test-cases to swallow errors rather than expect them
567 . HTMLDefinition printer updated with some of the new attributes
568 . DefinitionCache keys reordered to reflect precedence: version number,
569 hash, then revision number
570 . %Core.DefinitionCache renamed to %Cache.DefinitionImpl
571 . Interlinking in configuration documentation added using
572 Injector_PurifierLinkify
573 . Directives now keep track of aliases to themselves
574 . Error collector now requires a severity to be passed, use PHP's internal
575 error constants for this
576 . HTMLPurifier_Config::getAllowedDirectivesForForm implemented, allows
577 much easier selective embedding of configuration values
578 . Doctype objects now accept public and system DTD identifiers
579 . %HTML.Doctype is now constrained by specific values, to specify a custom
580 doctype use new %HTML.CustomDoctype
581 . ConfigForm truncates long directives to keep the form small, and does
582 not re-output namespaces
584 2.0.0, released 2007-06-20
585 # Completely refactored HTMLModuleManager, decentralizing safety
587 # Transform modules changed to Tidy modules, which offer more flexibility
588 and better modularization
589 # Configuration object now finalizes itself when a read operation is
590 performed on it, ensuring that its internal state stays consistent.
591 To revert this behavior, you can set the $autoFinalize member variable
592 off, but it's not recommended.
593 # New compact syntax for AttrDef objects that can be used to instantiate
594 new objects via make()
595 # Definitions (esp. HTMLDefinition) are now cached for a significant
596 performance boost. You can disable caching by setting %Core.DefinitionCache
597 to null. You CANNOT edit raw definitions without setting the corresponding
598 DefinitionID directive (%HTML.DefinitionID for HTMLDefinition).
599 # Contents between <script> tags are now completely removed if <script>
601 # Prototype-declarations for Lexer removed in favor of configuration
602 determination of Lexer implementations.
603 ! HTML Purifier now works in PHP 4.3.2.
604 ! Configuration form-editing API makes tweaking HTMLPurifier_Config a
606 ! Configuration directives that accept hashes now allow new string
607 format: key1:value1,key2:value2
608 ! ConfigDoc now factored into OOP design
609 ! All deprecated elements now natively supported
610 ! Implement TinyMCE styled whitelist specification format in
612 ! Config object gives more friendly error messages when things go wrong
613 ! Advanced API implemented: easy functions for creating elements (addElement)
614 and attributes (addAttribute) on HTMLDefinition
615 ! Add native support for required attributes
616 - Deprecated and removed EnableRedundantUTF8Cleaning. It didn't even work!
617 - DOMLex will not emit errors when a custom error handler that does not
618 honor error_reporting is used
619 - StrictBlockquote child definition refrains from wrapping whitespace
621 - Bug resulting from tag transforms to non-allowed elements fixed
622 - ChildDef_Custom's regex generation has been improved, removing several
624 . Unit test for ElementDef created, ElementDef behavior modified to
626 . Added convenience functions for HTMLModule constructors
627 . AttrTypes now has accessor functions that should be used instead
628 of directly manipulating info
629 . TagTransform_Center deprecated in favor of generic TagTransform_Simple
630 . Add extra protection in AttrDef_URI against phantom Schemes
631 . Doctype object added to HTMLDefinition which describes certain aspects
632 of the operational document type
633 . Lexer is now pre-emptively included, with a conditional include for the
635 . HTMLDefinition and CSSDefinition have a common parent class: Definition.
636 . DirectLex can now track line-numbers
637 . Preliminary error collector is in place, although no code actually reports
639 . Factor out most of ValidateAttributes to new AttrValidator class
641 1.6.1, released 2007-05-05
642 ! Support for more deprecated attributes via transformations:
643 + hspace and vspace in img
644 + size and noshade in hr
647 + align in caption, table, img and hr
648 + type in ul, ol and li
649 ! DirectLex now preserves text in which a < bracket is followed by
650 a non-alphanumeric character. This means that certain emoticons
652 ! %Core.RemoveInvalidImg is now operational, when set to false invalid
653 images will hang around with an empty src
654 ! target attribute in a tag supported, use %Attr.AllowedFrameTargets
656 ! CSS property white-space now allows nowrap (supported in all modern
657 browsers) but not others (which have spotty browser implementations)
658 ! XHTML 1.1 mode now sort-of works without any fatal errors, and
659 lang is now moved over to xml:lang.
660 ! Attribute transformation smoketest available at smoketests/attrTransform.php
661 ! Transformation of font's size attribute now handles super-large numbers
662 - Possibly fatal bug with __autoload() fixed in module manager
663 - Invert HTMLModuleManager->addModule() processing order to check
664 prefixes first and then the literal module
665 - Empty strings get converted to empty arrays instead of arrays with
666 an empty string in them.
667 - Merging in attribute lists now works.
668 . Demo script removed: it has been added to the website's repository
669 . Basic.php script modified to work out of the box
670 . Refactor AttrTransform classes to reduce duplication
671 . AttrTransform_TextAlign axed in favor of a more general
672 AttrTransform_EnumToCSS, refer to HTMLModule/TransformToStrict.php to
673 see how the new equivalent is implemented
674 . Unit tests now use exclusively assertIdentical
676 1.6.0, released 2007-04-01
677 ! Support for most common deprecated attributes via transformations:
678 + bgcolor in td, th, tr and table
681 + width in td, th and hr
683 ! Support for CSS attribute 'height' added
684 ! Support for rel and rev attributes in a tags added, use %Attr.AllowedRel
685 and %Attr.AllowedRev to activate
686 - You can define ID blacklists using regular expressions via
687 %Attr.IDBlacklistRegexp
688 - Error messages are emitted when you attempt to "allow" elements or
689 attributes that HTML Purifier does not support
690 - Fix segfault in unit test. The problem is not very reproduceable and
691 I don't know what causes it, but a six line patch fixed it.
693 1.5.0, released 2007-03-23
694 ! Added a rudimentary I18N and L10N system modeled off MediaWiki. It
695 doesn't actually do anything yet, but keep your eyes peeled.
696 ! docs/enduser-utf8.html explains how to use UTF-8 and HTML Purifier
697 ! Newly structured HTMLDefinition modeled off of XHTML 1.1 modules.
698 I am loathe to release beta quality APIs, but this is exactly that;
699 don't use the internal interfaces if you're not willing to do migration
701 - Allow 'x' subtag in language codes
702 - Fixed buggy chameleon-support for ins and del
703 . Added support for IDREF attributes (i.e. for)
704 . Renamed HTMLPurifier_AttrDef_Class to HTMLPurifier_AttrDef_Nmtokens
705 . Removed context variable ParentType, replaced with IsInline, which
706 is false when you're not inline and an integer of the parent that
707 caused you to become inline when you are (so possibly zero)
708 . Removed ElementDef->type in favor of ElementDef->descendants_are_inline
709 and HTMLDefinition->content_sets
710 . StrictBlockquote now reports what elements its supposed to allow,
711 rather than what it does allow
712 . Removed HTMLDefinition->info_flow_elements in favor of
713 HTMLDefinition->content_sets['Flow']
714 . Removed redundant "exclusionary" definitions from DTD roster
715 . StrictBlockquote now requires a construction parameter as if it
716 were an Required ChildDef, this is the "real" set of allowed elements
717 . AttrDef partitioned into HTML, CSS and URI segments
718 . Modify Youtube filter regexp to be multiline
719 . Require both PHP5 and DOM extension in order to use DOMLex, fixes
720 some edge cases where a DOMDocument class exists in a PHP4 environment
721 due to DOM XML extension.
723 1.4.1, released 2007-01-21
724 ! docs/enduser-youtube.html updated according to new functionality
725 - YouTube IDs can have underscores and dashes
727 1.4.0, released 2007-01-21
728 ! Implemented list-style-image, URIs now allowed in list-style
729 ! Implemented background-image, background-repeat, background-attachment
730 and background-position CSS properties. Shorthand property background
731 supports all of these properties.
732 ! Configuration documentation looks nicer
733 ! Added %Core.EscapeNonASCIICharacters to workaround loss of Unicode
734 characters while %Core.Encoding is set to a non-UTF-8 encoding.
735 ! Support for configuration directive aliases added
736 ! Config object can now be instantiated from ini files
737 ! YouTube preservation code added to the core, with two lines of code
738 you can add it as a filter to your code. See smoketests/preserveYouTube.php
740 ! Moved SLOW to docs/enduser-slow.html and added code examples
741 - Replaced version check with functionality check for DOM (thanks Stephen
743 . Added smoketest 'all.php', which loads all other smoketests via frames
744 . Implemented AttrDef_CSSURI for url(http://google.com) style declarations
745 . Added convenient single test selector form on test runner
747 1.3.2, released 2006-12-25
748 ! HTMLPurifier object now accepts configuration arrays, no need to manually
749 instantiate a configuration object
750 ! Context object now accessible to outside
751 ! Added enduser-youtube.html, explains how to embed YouTube videos. See
752 also corresponding smoketest preserveYouTube.php.
753 ! Added purifyArray(), which takes a list of HTML and purifies it all
754 ! Added static member variable $version to HTML Purifier with PHP-compatible
755 version number string.
756 - Fixed fatal error thrown by upper-cased language attributes
757 - printDefinition.php: added labels, added better clarification
758 . HTMLPurifier_Config::create() added, takes mixed variable and converts into
759 a HTMLPurifier_Config object.
761 1.3.1, released 2006-12-06
762 ! Added HTMLPurifier.func.php stub for a convenient function to call the library
763 - Fixed bug in RemoveInvalidImg code that caused all images to be dropped
764 (thanks to .mario for reporting this)
765 . Standardized all attribute handling variables to attr, made it plural
767 1.3.0, released 2006-11-26
768 # Invalid images are now removed, rather than replaced with a dud
769 <img src="" alt="Invalid image" />. Previous behavior can be restored
770 with new directive %Core.RemoveInvalidImg set to false.
771 ! (X)HTML Strict now supported
772 + Transparently handles inline elements in block context (blockquote)
773 ! Added GET method to demo for easier validation, added 50kb max input size
774 ! New directive %HTML.BlockWrapper, for block-ifying inline elements
775 ! New directive %HTML.Parent, allows you to only allow inline content
776 ! New directives %HTML.AllowedElements and %HTML.AllowedAttributes to let
777 users narrow the set of allowed tags
778 ! <li value="4"> and <ul start="2"> now allowed in loose mode
779 ! New directives %URI.DisableExternalResources and %URI.DisableResources
780 ! New directive %Attr.DisableURI, which eliminates all hyperlinking
781 ! New directive %URI.Munge, munges URI so you can use some sort of redirector
782 service to avoid PageRank leaks or warn users that they are exiting your site.
783 ! Added spiffy new smoketest printDefinition.php, which lets you twiddle with
784 the configuration settings and see how the internal rules are affected.
785 ! New directive %URI.HostBlacklist for blocking links to bad hosts.
786 xssAttacks.php smoketest updated accordingly.
787 - Added missing type to ChildDef_Chameleon
788 - Remove Tidy option from demo if there is not Tidy available
789 . ChildDef_Required guards against empty tags
790 . Lookup table HTMLDefinition->info_flow_elements added
791 . Added peace-of-mind variable initialization to Strategy_FixNesting
792 . Added HTMLPurifier->info_parent_def, parent child processing made special
793 . Added internal documents briefly summarizing future progression of HTML
794 . HTMLPurifier_Config->getBatch($namespace) added
795 . More lenient casting to bool from string in HTMLPurifier_ConfigSchema
796 . Refactored ChildDef classes into their own files
798 1.2.0, released 2006-11-19
799 # ID attributes now disabled by default. New directives:
800 + %HTML.EnableAttrID - restores old behavior by allowing IDs
801 + %Attr.IDPrefix - %Attr.IDBlacklist alternative that munges all user IDs
802 so that they don't collide with your IDs
803 + %Attr.IDPrefixLocal - Same as above, but for when there are multiple
804 instances of user content on the page
805 + Profuse documentation on how to use these available in docs/enduser-id.txt
806 ! Added MODx plugin <http://modxcms.com/forums/index.php/topic,6604.0.html>
807 ! Added percent encoding normalization
808 ! XSS attacks smoketest given facelift
809 ! Configuration documentation now has table of contents
810 ! Added %URI.DisableExternal, which prevents links to external websites. You
811 can also use %URI.Host to permit absolute linking to subdomains
812 ! Non-accessible resources (ex. mailto) blocked from embedded URIs (img src)
813 - Type variable in HTMLDefinition was not being set properly, fixed
814 - Documentation updated
815 + TODO added request Phalanger
816 + TODO added request Native compression
817 + TODO added request Remove redundant tags
818 + TODO added possible plaintext formatter for HTML Purifier documentation
819 + Updated ConfigDoc TODO
820 + Improved inline comments in AttrDef/Class.php, AttrDef/CSS.php
822 + Revamped documentation into HTML, along with misc updates
823 - HTMLPurifier_Context doesn't throw a variable reference error if you attempt
824 to retrieve a non-existent variable
825 . Switched to purify()-wide Context object registry
826 . Refactored unit tests to minimize duplication
827 . XSS attack sheet updated
828 . configdoc.xml now has xml:space attached to default value nodes
829 . Allow configuration directives to permit null values
830 . Cleaned up test-cases to remove unnecessary swallowErrors()
832 1.1.2, released 2006-09-30
833 ! Add HTMLPurifier.auto.php stub file that configures include_path
834 - Documentation updated
835 + INSTALL document rewritten
836 + TODO added semi-lossy conversion
837 + API Doxygen docs' file exclusions updated
838 + Added notes on HTML versus XML attribute whitespace handling
839 + Noted that HTMLPurifier_ChildDef_Custom isn't being used
840 + Noted that config object's definitions are cached versions
841 - Fixed lack of attribute parsing in HTMLPurifier_Lexer_PEARSax3
842 - ftp:// URIs now have their typecodes checked
843 - Hooked up HTMLPurifier_ChildDef_Custom's unit tests (they weren't being run)
844 . Line endings standardized throughout project (svn:eol-style standardized)
845 . Refactored parseData() to general Lexer class
846 . Tester named "HTML Purifier" not "HTMLPurifier"
848 1.1.1, released 2006-09-24
849 ! Configuration option to optionally Tidy up output for indentation to make up
850 for dropped whitespace by DOMLex (pretty-printing for the entire application
851 should be done by a page-wide Tidy)
852 - Various documentation updates
853 - Fixed parse error in configuration documentation script
854 - Fixed fatal error in benchmark scripts, slightly augmented
855 - As far as possible, whitespace is preserved in-between table children
856 - Sample test-settings.php file included
858 1.1.0, released 2006-09-16
859 ! Directive documentation generation using XSLT
860 ! XHTML can now be turned off, output becomes <br>
861 - Made URI validator more forgiving: will ignore leading and trailing
862 quotes, apostrophes and less than or greater than signs.
863 - Enforce alphanumeric namespace and directive names for configuration.
864 - Table child definition made more flexible, will fix up poorly ordered elements
865 . Renamed ConfigDef to ConfigSchema
867 1.0.1, released 2006-09-04
868 - Fixed slight bug in DOMLex attribute parsing
869 - Fixed rejection of case-insensitive configuration values when there is a
870 set of allowed values. This manifested in %Core.Encoding.
871 - Fixed rejection of inline style declarations that had lots of extra
872 space in them. This manifested in TinyMCE.
874 1.0.0, released 2006-09-01
875 ! Shorthand CSS properties implemented: font, border, background, list-style
876 ! Basic color keywords translated into hexadecimal values
877 ! Table CSS properties implemented
878 ! Support for charsets other than UTF-8 (defined by iconv)
879 ! Malformed UTF-8 and non-SGML character detection and cleaning implemented
880 - Fixed broken numeric entity conversion
881 - API documentation completed
882 . (HTML|CSS)Definition de-singleton-ized
884 1.0.0beta, released 2006-08-16
885 ! First public release, most functionality implemented. Notable omissions are:
886 + Shorthand CSS properties
887 + Table CSS properties
888 + Deprecated attribute transformations