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