]> git.wh0rd.org - tt-rss.git/blob - lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php
strip_tags_long: use htmlpurifier to properly reformat html content
[tt-rss.git] / lib / htmlpurifier / library / HTMLPurifier / AttrTransform / Name.php
1 <?php
2
3 /**
4 * Pre-transform that changes deprecated name attribute to ID if necessary
5 */
6 class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform
7 {
8
9 public function transform($attr, $config, $context) {
10 if (!isset($attr['name'])) return $attr;
11 $id = $this->confiscateAttr($attr, 'name');
12 if ( isset($attr['id'])) return $attr;
13 $attr['id'] = $id;
14 return $attr;
15 }
16
17 }
18
19 // vim: et sw=4 sts=4