Filter.ExtractStyleBlocks
TYPE: bool
VERSION: 3.1.0
DEFAULT: false
EXTERNAL: CSSTidy
--DESCRIPTION--
<p>
  This directive turns on the style block extraction filter, which removes
  <code>style</code> blocks from input HTML, cleans them up with CSSTidy,
  and places them in the <code>StyleBlocks</code> context variable, for further
  use by you, usually to be placed in an external stylesheet, or a
  <code>style</code> block in the <code>head</code> of your document.
</p>
<p>
  Sample usage:
</p>
<pre><![CDATA[$config = HTMLPurifier_Config::createDefault();
$config->set('Filter', 'ExtractStyleBlocks', true);
$purifier = new HTMLPurifier($config);
$styles = $purifier->context->get('StyleBlocks');
foreach ($styles as $style) {
    echo '<style type="text/css">' . $style . "</style>\n";
}]]></pre>
<p>
  <strong>Warning:</strong> It is possible for a user to mount an
  imagecrash attack using this CSS. Counter-measures are difficult;
  it is not simply enough to limit the range of CSS lengths (using
  relative lengths with many nesting levels allows for large values
  to be attained without actually specifying them in the stylesheet),
  and the flexible nature of selectors makes it difficult to selectively
  disable lengths on image tags (HTML Purifier, however, does disable
  CSS width and height in inline styling). There are probably two effective
  counter measures: an explicit width and height set to auto in all
  images in your document (unlikely) or the disabling of width and
  height (somewhat reasonable). Whether or not these measures should be
  used is left to the reader.
</p>
