SafeObject.php 609 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Writes default type for all objects. Currently only supports flash.
  4. */
  5. class HTMLPurifier_AttrTransform_SafeObject extends HTMLPurifier_AttrTransform
  6. {
  7. /**
  8. * @type string
  9. */
  10. public $name = "SafeObject";
  11. /**
  12. * @param array $attr
  13. * @param HTMLPurifier_Config $config
  14. * @param HTMLPurifier_Context $context
  15. * @return array
  16. */
  17. public function transform($attr, $config, $context)
  18. {
  19. if (!isset($attr['type'])) {
  20. $attr['type'] = 'application/x-shockwave-flash';
  21. }
  22. return $attr;
  23. }
  24. }
  25. // vim: et sw=4 sts=4