HTMLPurifier 4.4.0
/home/ezyang/Dev/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform
00007 {
00008 
00009     public function transform($attr, $config, $context) {
00010         // Abort early if we're using relaxed definition of name
00011         if ($config->get('HTML.Attr.Name.UseCDATA')) return $attr;
00012         if (!isset($attr['name'])) return $attr;
00013         $id = $this->confiscateAttr($attr, 'name');
00014         if ( isset($attr['id']))   return $attr;
00015         $attr['id'] = $id;
00016         return $attr;
00017     }
00018 
00019 }
00020 
00021 // vim: et sw=4 sts=4