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