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