PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/vjCommentPlugin/lib/tools/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php

https://bitbucket.org/Kudlaty/360kdw
PHP | 34 lines | 23 code | 7 blank | 4 comment | 0 complexity | 6b1194cb01892e9bec3dab35854b5b52 MD5 | raw file
Possible License(s): LGPL-2.1
  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. 'flashvars' => 'Text',
  20. 'wmode' => 'Enum#window',
  21. 'name' => 'ID',
  22. )
  23. );
  24. $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed();
  25. }
  26. }
  27. // vim: et sw=4 sts=4