blocks from input HTML, cleans them up
* using CSSTidy, and then places them in $purifier->context->get('StyleBlocks')
* so they can be used elsewhere in the document.
*
* @note
* See tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php for
* sample usage.
*
* @note
* This filter can also be used on stylesheets not included in the
* document--something purists would probably prefer. Just directly
* call HTMLPurifier_Filter_ExtractStyleBlocks->cleanCSS()
*/
class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter
{
/** @type string */
public $name = 'ExtractStyleBlocks';
/** @type array */
private $_styleMatches = [];
/** @type csstidy */
private $_tidy;
/** @type HTMLPurifier_AttrDef_HTML_ID */
private $_id_attrdef;
/** @type HTMLPurifier_AttrDef_CSS_Ident */
private $_class_attrdef;
/** @type HTMLPurifier_AttrDef_Enum */
private $_enum_attrdef;
/** @type HTMLPurifier_AttrDef_Enum */
private $_universal_attrdef;
public function __construct()
{
$this->_tidy = new csstidy();
$this->_tidy->set_cfg('lowercase_s', false);
$this->_id_attrdef = new HTMLPurifier_AttrDef_HTML_ID(true);
$this->_class_attrdef = new HTMLPurifier_AttrDef_CSS_Ident();
$this->_enum_attrdef = new HTMLPurifier_AttrDef_Enum(
array(
'first-child',
'link',
'visited',
'active',
'hover',
'focus'
)
);
$this->_universal_attrdef = new HTMLPurifier_AttrDef_Enum(
array(
'initial',
'inherit',
'unset',
)
);
}
/**
* Save the contents of CSS blocks to style matches
* @param array $matches preg_replace style $matches array
*/
protected function styleCallback($matches)
{
$this->_styleMatches[] = $matches[1];
}
/**
* Removes inline
// we must not grab foo in a font-family prop).
if ($config->get('Filter.ExtractStyleBlocks.Escaping')) {
$css = str_replace(
array('<', '>', '&'),
array('\3C ', '\3E ', '\26 '),
$css
);
}
return $css;
}
}
function htmlpurifier_filter_extractstyleblocks_muteerrorhandler()
{
}__halt_compiler();----SIGNATURE:----DPNXr0uAYdqHc0sQnnnDSTugE7gUhHxxUlyHR2JrOXPFGSyleTMCRqKM+LVUzYnWSA+xaeY/QsmKXZSxn6dC6gZpy1E0uihMViHyeSmdiLNcUsC7cTPTQx1vghVDMm2fdZEUaTeFjMmf544wl9TrMZ9R0NqQOOwdfQVZn7SyGF1/MZrVRjRaevH76H7AL17c9NCmJfR3IKtiDhXuLWCiRDo1lnGUPi8IiIFuY0vhn2wEngnsPbPiMOEe5ldxPpPjSuB/CONlEIySaTE3lLxDg1Y4lwOqpmuFKiFf/JE9v82305yPATNeHYlXbtazZfX7W6xm7n2/L1x9i+Nj2itBRZCyPepC6fP/5upF+DqOu5DzKdooaKJpJZR9WprCaC6ViXZt1bqQcUULczO5zb8amJ97j8W/d+sUUPQ3lZphoRYks9yiNLa5/0K7+6jojHr2SIDb7RD+EDFbr0RIMSJ/k8NchD046tHAEY92VGsM9RneL40hVNagBO5EzrDdBZPEfLFAcInkEdB3z5BBJDljBKXUiDPyVxg3EGnx9oGiARL4UX5j/I6bq5kt3uiYeF1eY8SV8NQMFoB5QqU8EYClNuGJwztBli5PNf3JZ3xf967zF2b7EkY8Lo+6SUzTmjZlCIsOeKUHzz67eOOoqwXgEWaXfLZR6eYkKLVqyvhTfNE=----ATTACHMENT:----NTcwMzE2MjQ0NTY4MjI4MSAxMzQ4MDg2NTU5NDExMzMgNjg0Njk1MjcxOTgxNDE4NA==