Name.php 669 B

1234567891011121314151617181920212223242526
  1. <?php
  2. class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule
  3. {
  4. /**
  5. * @type string
  6. */
  7. public $name = 'Name';
  8. /**
  9. * @param HTMLPurifier_Config $config
  10. */
  11. public function setup($config)
  12. {
  13. $elements = array('a', 'applet', 'form', 'frame', 'iframe', 'img', 'map');
  14. foreach ($elements as $name) {
  15. $element = $this->addBlankElement($name);
  16. $element->attr['name'] = 'CDATA';
  17. if (!$config->get('HTML.Attr.Name.UseCDATA')) {
  18. $element->attr_transform_post[] = new HTMLPurifier_AttrTransform_NameSync();
  19. }
  20. }
  21. }
  22. }
  23. // vim: et sw=4 sts=4