1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 14:25:55 +00:00

strip_tags_long: use htmlpurifier to properly reformat html content

This commit is contained in:
Andrew Dolgov
2009-06-22 13:56:49 +04:00
parent 5c4461432c
commit f45a286b8d
337 changed files with 24140 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
<?php
/**
* Pre-transform that changes proprietary background attribute to CSS.
*/
class HTMLPurifier_AttrTransform_Background extends HTMLPurifier_AttrTransform {
public function transform($attr, $config, $context) {
if (!isset($attr['background'])) return $attr;
$background = $this->confiscateAttr($attr, 'background');
// some validation should happen here
$this->prependCSS($attr, "background-image:url($background);");
return $attr;
}
}
// vim: et sw=4 sts=4