You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
526B

  1. <?php
  2. /**
  3. * Module adds the target-based noreferrer attribute transformation to a tags. It
  4. * is enabled by HTML.TargetNoreferrer
  5. */
  6. class HTMLPurifier_HTMLModule_TargetNoreferrer extends HTMLPurifier_HTMLModule
  7. {
  8. /**
  9. * @type string
  10. */
  11. public $name = 'TargetNoreferrer';
  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_TargetNoreferrer();
  18. }
  19. }