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.

39 lines
834B

  1. <?php
  2. /**
  3. * Special-case enum attribute definition that lazy loads allowed frame targets
  4. */
  5. class HTMLPurifier_AttrDef_HTML_FrameTarget extends HTMLPurifier_AttrDef_Enum
  6. {
  7. /**
  8. * @type array
  9. */
  10. public $valid_values = false; // uninitialized value
  11. /**
  12. * @type bool
  13. */
  14. protected $case_sensitive = false;
  15. public function __construct()
  16. {
  17. }
  18. /**
  19. * @param string $string
  20. * @param HTMLPurifier_Config $config
  21. * @param HTMLPurifier_Context $context
  22. * @return bool|string
  23. */
  24. public function validate($string, $config, $context)
  25. {
  26. if ($this->valid_values === false) {
  27. $this->valid_values = $config->get('Attr.AllowedFrameTargets');
  28. }
  29. return parent::validate($string, $config, $context);
  30. }
  31. }
  32. // vim: et sw=4 sts=4