1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 12:05: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,19 @@
<?php
/**
* Pre-transform that changes deprecated name attribute to ID if necessary
*/
class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform
{
public function transform($attr, $config, $context) {
if (!isset($attr['name'])) return $attr;
$id = $this->confiscateAttr($attr, 'name');
if ( isset($attr['id'])) return $attr;
$attr['id'] = $id;
return $attr;
}
}
// vim: et sw=4 sts=4