Release 2.1.1.
[htmlpurifier.git] / NEWS
blobb88f59bc2ca676995bd174bbf8efd50d4ed86bc4
1 NEWS ( CHANGELOG and HISTORY )                                     HTMLPurifier
2 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 = KEY ====================
5     # Breaks back-compat
6     ! Feature
7     - Bugfix
8       + Sub-comment
9     . Internal change
10 ==========================
12 2.1.1, released 2007-08-04
13 - Fix show-stopper bug in %URI.MakeAbsolute functionality
14 - Fix PHP4 syntax error in standalone version
15 . Add prefix directory to include path for standalone, this prevents
16   other installations from clobbering the standalone's URI schemes
17 . Single test methods can be invoked by prefixing with __only
19 2.1.0, released 2007-08-02
20 # flush-htmldefinition-cache.php superseded in favor of a generic
21   flush-definition-cache.php script, you can clear a specific cache
22   by passing its name as a parameter to the script
23 ! Phorum mod implemented for HTML Purifier
24 ! With %Core.AggressivelyFixLt, <3 and similar emoticons no longer
25   trigger HTML removal in PHP5 (DOMLex). This directive is not necessary
26   for PHP4 (DirectLex).
27 ! Standalone file now available, which greatly reduces the amount of
28   includes (although there are still a few files that reside in the
29   standalone folder)
30 ! Relative URIs can now be transformed into their absolute equivalents
31   using %URI.Base and %URI.MakeAbsolute
32 ! Ruby implemented for XHTML 1.1
33 ! You can now define custom URI filtering behavior, see enduser-uri-filter.html
34   for more details
35 ! UTF-8 font names now supported in CSS
36 - AutoFormatters emit friendly error messages if tags or attributes they
37   need are not allowed
38 - ConfigForm's compactification of directive names is now configurable
39 - AutoParagraph autoformatter algorithm refined after field-testing
40 - XHTML 1.1 now applies XHTML 1.0 Strict cleanup routines, namely
41   blockquote wrapping
42 - Contents of <style> tags removed by default when tags are removed
43 . HTMLPurifier_Config->getSerial() implemented, this is extremely useful
44   for output cache invalidation
45 . ConfigForm printer now can retrieve CSS and JS files as strings, in
46   case HTML Purifier's directory is not publically accessible
47 . Introduce new text/itext configuration directive values: these represent
48   longer strings that would be more appropriately edited with a textarea
49 . Allow newlines to act as separators for lists, hashes, lookups and
50   %HTML.Allowed
51 . ConfigForm generates textareas instead of text inputs for lists, hashes,
52   lookups, text and itext fields
53 . Hidden element content removal genericized: %Core.HiddenElements can
54   be used to customize this behavior, by default <script> and <style> are
55   hidden
56 . Added HTMLPURIFIER_PREFIX constant, should be used instead of dirname(__FILE__)
57 . Custom ChildDef added to default include list
58 . URIScheme reflection improved: will not attempt to include file if class
59   already exists. May clobber autoload, so I need to keep an eye on it
60 . ConfigSchema heavily optimized, will only collect information and validate
61   definitions when HTMLPURIFIER_SCHEMA_STRICT is true.
62 . AttrDef_URI unit tests and implementation refactored
63 . benchmarks/ directory now protected from public view with .htaccess file;
64   run the tests via command line
65 . URI scheme is munged off if there is no authority and the scheme is the
66   default one
67 . All unit tests inherit from HTMLPurifier_Harness, not UnitTestCase
68 . Interface for URIScheme changed
69 . Generic URI object to hold components of URI added, most systems involved
70   in URI validation have been migrated to use it
71 . Custom filtering for URIs factored out to URIDefinition interface for
72   maximum extensibility
74 2.0.1, released 2007-06-27
75 ! Tag auto-closing now based on a ChildDef heuristic rather than a
76   manually set auto_close array; some behavior may change
77 ! Experimental AutoFormat functionality added: auto-paragraph and
78   linkify your HTML input by setting %AutoFormat.AutoParagraph and
79   %AutoFormat.Linkify to true
80 ! Newlines normalized internally, and then converted back to the
81   value of PHP_EOL. If this is not desired, set your newline format
82   using %Output.Newline.
83 ! Beta error collection, messages are implemented for the most generic
84   cases involving Lexing or Strategies
85 - Clean up special case code for <script> tags
86 - Reorder includes for DefinitionCache decorators, fixes a possible
87   missing class error
88 - Fixed bug where manually modified definitions were not saved via cache
89   (mostly harmless, except for the fact that it would be a little slower)
90 - Configuration objects with different serials do not clobber each
91   others when revision numbers are unequal
92 - Improve Serializer DefinitionCache directory permissions checks
93 - DefinitionCache no longer throws errors when it encounters old
94   serial files that do not conform to the current style
95 - Stray xmlns attributes removed from configuration documentation
96 - configForm.php smoketest no longer has XSS vulnerability due to
97   unescaped print_r output
98 - Printer adheres to configuration's directives on output format
99 - Fix improperly named form field in ConfigForm printer
100 . Rewire some test-cases to swallow errors rather than expect them
101 . HTMLDefinition printer updated with some of the new attributes
102 . DefinitionCache keys reordered to reflect precedence: version number,
103   hash, then revision number
104 . %Core.DefinitionCache renamed to %Cache.DefinitionImpl
105 . Interlinking in configuration documentation added using
106   Injector_PurifierLinkify
107 . Directives now keep track of aliases to themselves
108 . Error collector now requires a severity to be passed, use PHP's internal
109   error constants for this
110 . HTMLPurifier_Config::getAllowedDirectivesForForm implemented, allows
111   much easier selective embedding of configuration values
112 . Doctype objects now accept public and system DTD identifiers
113 . %HTML.Doctype is now constrained by specific values, to specify a custom
114   doctype use new %HTML.CustomDoctype
115 . ConfigForm truncates long directives to keep the form small, and does
116   not re-output namespaces
118 2.0.0, released 2007-06-20
119 # Completely refactored HTMLModuleManager, decentralizing safety
120   information
121 # Transform modules changed to Tidy modules, which offer more flexibility
122   and better modularization
123 # Configuration object now finalizes itself when a read operation is
124   performed on it, ensuring that its internal state stays consistent.
125   To revert this behavior, you can set the $autoFinalize member variable 
126   off, but it's not recommended.
127 # New compact syntax for AttrDef objects that can be used to instantiate
128   new objects via make()
129 # Definitions (esp. HTMLDefinition) are now cached for a significant
130   performance boost. You can disable caching by setting %Core.DefinitionCache
131   to null. You CANNOT edit raw definitions without setting the corresponding
132   DefinitionID directive (%HTML.DefinitionID for HTMLDefinition).
133 # Contents between <script> tags are now completely removed if <script>
134   is not allowed
135 # Prototype-declarations for Lexer removed in favor of configuration
136   determination of Lexer implementations.
137 ! HTML Purifier now works in PHP 4.3.2.
138 ! Configuration form-editing API makes tweaking HTMLPurifier_Config a
139   breeze!
140 ! Configuration directives that accept hashes now allow new string
141   format: key1:value1,key2:value2
142 ! ConfigDoc now factored into OOP design
143 ! All deprecated elements now natively supported
144 ! Implement TinyMCE styled whitelist specification format in
145   %HTML.Allowed
146 ! Config object gives more friendly error messages when things go wrong
147 ! Advanced API implemented: easy functions for creating elements (addElement)
148   and attributes (addAttribute) on HTMLDefinition
149 ! Add native support for required attributes
150 - Deprecated and removed EnableRedundantUTF8Cleaning. It didn't even work!
151 - DOMLex will not emit errors when a custom error handler that does not
152   honor error_reporting is used
153 - StrictBlockquote child definition refrains from wrapping whitespace
154   in tags now.
155 - Bug resulting from tag transforms to non-allowed elements fixed
156 - ChildDef_Custom's regex generation has been improved, removing several
157   false positives
158 . Unit test for ElementDef created, ElementDef behavior modified to
159   be more flexible
160 . Added convenience functions for HTMLModule constructors
161 . AttrTypes now has accessor functions that should be used instead
162   of directly manipulating info
163 . TagTransform_Center deprecated in favor of generic TagTransform_Simple
164 . Add extra protection in AttrDef_URI against phantom Schemes
165 . Doctype object added to HTMLDefinition which describes certain aspects
166   of the operational document type
167 . Lexer is now pre-emptively included, with a conditional include for the
168   PHP5 only version.
169 . HTMLDefinition and CSSDefinition have a common parent class: Definition.
170 . DirectLex can now track line-numbers
171 . Preliminary error collector is in place, although no code actually reports
172   errors yet
173 . Factor out most of ValidateAttributes to new AttrValidator class
175 1.6.1, released 2007-05-05
176 ! Support for more deprecated attributes via transformations:
177   + hspace and vspace in img
178   + size and noshade in hr
179   + nowrap in td
180   + clear in br
181   + align in caption, table, img and hr
182   + type in ul, ol and li
183 ! DirectLex now preserves text in which a < bracket is followed by
184   a non-alphanumeric character. This means that certain emoticons
185   are now preserved.
186 ! %Core.RemoveInvalidImg is now operational, when set to false invalid
187   images will hang around with an empty src
188 ! target attribute in a tag supported, use %Attr.AllowedFrameTargets
189   to enable
190 ! CSS property white-space now allows nowrap (supported in all modern
191   browsers) but not others (which have spotty browser implementations)
192 ! XHTML 1.1 mode now sort-of works without any fatal errors, and
193   lang is now moved over to xml:lang.
194 ! Attribute transformation smoketest available at smoketests/attrTransform.php
195 ! Transformation of font's size attribute now handles super-large numbers
196 - Possibly fatal bug with __autoload() fixed in module manager
197 - Invert HTMLModuleManager->addModule() processing order to check
198   prefixes first and then the literal module
199 - Empty strings get converted to empty arrays instead of arrays with
200   an empty string in them.
201 - Merging in attribute lists now works.
202 . Demo script removed: it has been added to the website's repository
203 . Basic.php script modified to work out of the box
204 . Refactor AttrTransform classes to reduce duplication
205 . AttrTransform_TextAlign axed in favor of a more general
206   AttrTransform_EnumToCSS, refer to HTMLModule/TransformToStrict.php to
207   see how the new equivalent is implemented
208 . Unit tests now use exclusively assertIdentical
210 1.6.0, released 2007-04-01
211 ! Support for most common deprecated attributes via transformations:
212   + bgcolor in td, th, tr and table
213   + border in img
214   + name in a and img
215   + width in td, th and hr
216   + height in td, th
217 ! Support for CSS attribute 'height' added
218 ! Support for rel and rev attributes in a tags added, use %Attr.AllowedRel
219   and %Attr.AllowedRev to activate
220 - You can define ID blacklists using regular expressions via
221   %Attr.IDBlacklistRegexp
222 - Error messages are emitted when you attempt to "allow" elements or
223   attributes that HTML Purifier does not support
224 - Fix segfault in unit test. The problem is not very reproduceable and
225   I don't know what causes it, but a six line patch fixed it.
227 1.5.0, released 2007-03-23
228 ! Added a rudimentary I18N and L10N system modeled off MediaWiki. It
229   doesn't actually do anything yet, but keep your eyes peeled.
230 ! docs/enduser-utf8.html explains how to use UTF-8 and HTML Purifier
231 ! Newly structured HTMLDefinition modeled off of XHTML 1.1 modules.
232   I am loathe to release beta quality APIs, but this is exactly that;
233   don't use the internal interfaces if you're not willing to do migration
234   later on.
235 - Allow 'x' subtag in language codes
236 - Fixed buggy chameleon-support for ins and del
237 . Added support for IDREF attributes (i.e. for)
238 . Renamed HTMLPurifier_AttrDef_Class to HTMLPurifier_AttrDef_Nmtokens
239 . Removed context variable ParentType, replaced with IsInline, which
240   is false when you're not inline and an integer of the parent that
241   caused you to become inline when you are (so possibly zero)
242 . Removed ElementDef->type in favor of ElementDef->descendants_are_inline
243   and HTMLDefinition->content_sets
244 . StrictBlockquote now reports what elements its supposed to allow,
245   rather than what it does allow
246 . Removed HTMLDefinition->info_flow_elements in favor of
247   HTMLDefinition->content_sets['Flow']
248 . Removed redundant "exclusionary" definitions from DTD roster
249 . StrictBlockquote now requires a construction parameter as if it
250   were an Required ChildDef, this is the "real" set of allowed elements
251 . AttrDef partitioned into HTML, CSS and URI segments
252 . Modify Youtube filter regexp to be multiline
253 . Require both PHP5 and DOM extension in order to use DOMLex, fixes
254   some edge cases where a DOMDocument class exists in a PHP4 environment
255   due to DOM XML extension.
257 1.4.1, released 2007-01-21
258 ! docs/enduser-youtube.html updated according to new functionality
259 - YouTube IDs can have underscores and dashes
261 1.4.0, released 2007-01-21
262 ! Implemented list-style-image, URIs now allowed in list-style
263 ! Implemented background-image, background-repeat, background-attachment
264   and background-position CSS properties. Shorthand property background
265   supports all of these properties.
266 ! Configuration documentation looks nicer
267 ! Added %Core.EscapeNonASCIICharacters to workaround loss of Unicode
268   characters while %Core.Encoding is set to a non-UTF-8 encoding.
269 ! Support for configuration directive aliases added
270 ! Config object can now be instantiated from ini files
271 ! YouTube preservation code added to the core, with two lines of code
272   you can add it as a filter to your code. See smoketests/preserveYouTube.php
273   for sample code.
274 ! Moved SLOW to docs/enduser-slow.html and added code examples
275 - Replaced version check with functionality check for DOM (thanks Stephen
276   Khoo)
277 . Added smoketest 'all.php', which loads all other smoketests via frames
278 . Implemented AttrDef_CSSURI for url(http://google.com) style declarations
279 . Added convenient single test selector form on test runner
281 1.3.2, released 2006-12-25
282 ! HTMLPurifier object now accepts configuration arrays, no need to manually
283   instantiate a configuration object
284 ! Context object now accessible to outside
285 ! Added enduser-youtube.html, explains how to embed YouTube videos. See
286   also corresponding smoketest preserveYouTube.php.
287 ! Added purifyArray(), which takes a list of HTML and purifies it all
288 ! Added static member variable $version to HTML Purifier with PHP-compatible
289   version number string.
290 - Fixed fatal error thrown by upper-cased language attributes
291 - printDefinition.php: added labels, added better clarification
292 . HTMLPurifier_Config::create() added, takes mixed variable and converts into
293   a HTMLPurifier_Config object.
295 1.3.1, released 2006-12-06
296 ! Added HTMLPurifier.func.php stub for a convenient function to call the library
297 - Fixed bug in RemoveInvalidImg code that caused all images to be dropped
298   (thanks to .mario for reporting this)
299 . Standardized all attribute handling variables to attr, made it plural
301 1.3.0, released 2006-11-26
302 # Invalid images are now removed, rather than replaced with a dud
303   <img src="" alt="Invalid image" />. Previous behavior can be restored
304   with new directive %Core.RemoveInvalidImg set to false.
305 ! (X)HTML Strict now supported
306   + Transparently handles inline elements in block context (blockquote)
307 ! Added GET method to demo for easier validation, added 50kb max input size
308 ! New directive %HTML.BlockWrapper, for block-ifying inline elements
309 ! New directive %HTML.Parent, allows you to only allow inline content
310 ! New directives %HTML.AllowedElements and %HTML.AllowedAttributes to let
311   users narrow the set of allowed tags
312 ! <li value="4"> and <ul start="2"> now allowed in loose mode
313 ! New directives %URI.DisableExternalResources and %URI.DisableResources
314 ! New directive %Attr.DisableURI, which eliminates all hyperlinking
315 ! New directive %URI.Munge, munges URI so you can use some sort of redirector
316   service to avoid PageRank leaks or warn users that they are exiting your site.
317 ! Added spiffy new smoketest printDefinition.php, which lets you twiddle with
318   the configuration settings and see how the internal rules are affected.
319 ! New directive %URI.HostBlacklist for blocking links to bad hosts.
320   xssAttacks.php smoketest updated accordingly.
321 - Added missing type to ChildDef_Chameleon
322 - Remove Tidy option from demo if there is not Tidy available
323 . ChildDef_Required guards against empty tags
324 . Lookup table HTMLDefinition->info_flow_elements added
325 . Added peace-of-mind variable initialization to Strategy_FixNesting
326 . Added HTMLPurifier->info_parent_def, parent child processing made special
327 . Added internal documents briefly summarizing future progression of HTML
328 . HTMLPurifier_Config->getBatch($namespace) added
329 . More lenient casting to bool from string in HTMLPurifier_ConfigSchema
330 . Refactored ChildDef classes into their own files
332 1.2.0, released 2006-11-19
333 # ID attributes now disabled by default. New directives:
334   + %HTML.EnableAttrID - restores old behavior by allowing IDs
335   + %Attr.IDPrefix - %Attr.IDBlacklist alternative that munges all user IDs
336     so that they don't collide with your IDs
337   + %Attr.IDPrefixLocal - Same as above, but for when there are multiple
338     instances of user content on the page
339   + Profuse documentation on how to use these available in docs/enduser-id.txt
340 ! Added MODx plugin <http://modxcms.com/forums/index.php/topic,6604.0.html>
341 ! Added percent encoding normalization
342 ! XSS attacks smoketest given facelift
343 ! Configuration documentation now has table of contents
344 ! Added %URI.DisableExternal, which prevents links to external websites.  You
345   can also use %URI.Host to permit absolute linking to subdomains
346 ! Non-accessible resources (ex. mailto) blocked from embedded URIs (img src)
347 - Type variable in HTMLDefinition was not being set properly, fixed
348 - Documentation updated
349   + TODO added request Phalanger
350   + TODO added request Native compression
351   + TODO added request Remove redundant tags
352   + TODO added possible plaintext formatter for HTML Purifier documentation
353   + Updated ConfigDoc TODO
354   + Improved inline comments in AttrDef/Class.php, AttrDef/CSS.php
355     and AttrDef/Host.php
356   + Revamped documentation into HTML, along with misc updates
357 - HTMLPurifier_Context doesn't throw a variable reference error if you attempt
358   to retrieve a non-existent variable
359 . Switched to purify()-wide Context object registry
360 . Refactored unit tests to minimize duplication
361 . XSS attack sheet updated
362 . configdoc.xml now has xml:space attached to default value nodes
363 . Allow configuration directives to permit null values
364 . Cleaned up test-cases to remove unnecessary swallowErrors()
366 1.1.2, released 2006-09-30
367 ! Add HTMLPurifier.auto.php stub file that configures include_path
368 - Documentation updated
369   + INSTALL document rewritten
370   + TODO added semi-lossy conversion
371   + API Doxygen docs' file exclusions updated
372   + Added notes on HTML versus XML attribute whitespace handling
373   + Noted that HTMLPurifier_ChildDef_Custom isn't being used
374   + Noted that config object's definitions are cached versions
375 - Fixed lack of attribute parsing in HTMLPurifier_Lexer_PEARSax3
376 - ftp:// URIs now have their typecodes checked
377 - Hooked up HTMLPurifier_ChildDef_Custom's unit tests (they weren't being run)
378 . Line endings standardized throughout project (svn:eol-style standardized)
379 . Refactored parseData() to general Lexer class
380 . Tester named "HTML Purifier" not "HTMLPurifier"
382 1.1.1, released 2006-09-24
383 ! Configuration option to optionally Tidy up output for indentation to make up
384   for dropped whitespace by DOMLex (pretty-printing for the entire application
385   should be done by a page-wide Tidy)
386 - Various documentation updates
387 - Fixed parse error in configuration documentation script
388 - Fixed fatal error in benchmark scripts, slightly augmented
389 - As far as possible, whitespace is preserved in-between table children
390 - Sample test-settings.php file included
392 1.1.0, released 2006-09-16
393 ! Directive documentation generation using XSLT
394 ! XHTML can now be turned off, output becomes <br>
395 - Made URI validator more forgiving: will ignore leading and trailing
396   quotes, apostrophes and less than or greater than signs.
397 - Enforce alphanumeric namespace and directive names for configuration.
398 - Table child definition made more flexible, will fix up poorly ordered elements
399 . Renamed ConfigDef to ConfigSchema
401 1.0.1, released 2006-09-04
402 - Fixed slight bug in DOMLex attribute parsing
403 - Fixed rejection of case-insensitive configuration values when there is a
404   set of allowed values.  This manifested in %Core.Encoding.
405 - Fixed rejection of inline style declarations that had lots of extra
406   space in them.  This manifested in TinyMCE.
408 1.0.0, released 2006-09-01
409 ! Shorthand CSS properties implemented: font, border, background, list-style
410 ! Basic color keywords translated into hexadecimal values
411 ! Table CSS properties implemented
412 ! Support for charsets other than UTF-8 (defined by iconv)
413 ! Malformed UTF-8 and non-SGML character detection and cleaning implemented
414 - Fixed broken numeric entity conversion
415 - API documentation completed
416 . (HTML|CSS)Definition de-singleton-ized
418 1.0.0beta, released 2006-08-16
419 ! First public release, most functionality implemented. Notable omissions are:
420   + Shorthand CSS properties
421   + Table CSS properties
422   + Deprecated attribute transformations