FrameTarget.php 834 B

1234567891011121314151617181920212223242526272829303132333435363738
  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