TargetNoopener.php 516 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * Module adds the target-based noopener attribute transformation to a tags. It
  4. * is enabled by HTML.TargetNoopener
  5. */
  6. class HTMLPurifier_HTMLModule_TargetNoopener extends HTMLPurifier_HTMLModule
  7. {
  8. /**
  9. * @type string
  10. */
  11. public $name = 'TargetNoopener';
  12. /**
  13. * @param HTMLPurifier_Config $config
  14. */
  15. public function setup($config) {
  16. $a = $this->addBlankElement('a');
  17. $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_TargetNoopener();
  18. }
  19. }