File indexing completed on 2024-05-12 06:02:05

0001 <?php
0002 
0003 /**
0004  * A "safe" embed module. See SafeObject. This is a proprietary element.
0005  */
0006 class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
0007 {
0008     /**
0009      * @type string
0010      */
0011     public $name = 'SafeEmbed';
0012 
0013     /**
0014      * @param HTMLPurifier_Config $config
0015      */
0016     public function setup($config)
0017     {
0018         $max = $config->get('HTML.MaxImgLength');
0019         $embed = $this->addElement(
0020             'embed',
0021             'Inline',
0022             'Empty',
0023             'Common',
0024             array(
0025                 'src*' => 'URI#embedded',
0026                 'type' => 'Enum#application/x-shockwave-flash',
0027                 'width' => 'Pixels#' . $max,
0028                 'height' => 'Pixels#' . $max,
0029                 'allowscriptaccess' => 'Enum#never',
0030                 'allownetworking' => 'Enum#internal',
0031                 'flashvars' => 'Text',
0032                 'wmode' => 'Enum#window,transparent,opaque',
0033                 'name' => 'ID',
0034             )
0035         );
0036         $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed();
0037     }
0038 }
0039 
0040 // vim: et sw=4 sts=4