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