SafeEmbed.php 1009 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * A "safe" embed module. See SafeObject. This is a proprietary element.
  4. */
  5. class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
  6. {
  7. public $name = 'SafeEmbed';
  8. public function setup($config) {
  9. $max = $config->get('HTML.MaxImgLength');
  10. $embed = $this->addElement(
  11. 'embed', 'Inline', 'Empty', 'Common',
  12. array(
  13. 'src*' => 'URI#embedded',
  14. 'type' => 'Enum#application/x-shockwave-flash',
  15. 'width' => 'Pixels#' . $max,
  16. 'height' => 'Pixels#' . $max,
  17. 'allowscriptaccess' => 'Enum#never',
  18. 'allownetworking' => 'Enum#internal',
  19. 'allowfullscreen' => 'Enum#true,false',
  20. 'flashvars' => 'Text',
  21. 'wmode' => 'Enum#window',
  22. 'name' => 'ID',
  23. )
  24. );
  25. $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed();
  26. }
  27. }
  28. // vim: et sw=4 sts=4