HTMLPurifier 4.4.0
/home/ezyang/Dev/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
00007 {
00008 
00009     public $name = 'SafeEmbed';
00010 
00011     public function setup($config) {
00012 
00013         $max = $config->get('HTML.MaxImgLength');
00014         $embed = $this->addElement(
00015             'embed', 'Inline', 'Empty', 'Common',
00016             array(
00017                 'src*' => 'URI#embedded',
00018                 'type' => 'Enum#application/x-shockwave-flash',
00019                 'width' => 'Pixels#' . $max,
00020                 'height' => 'Pixels#' . $max,
00021                 'allowscriptaccess' => 'Enum#never',
00022                 'allownetworking' => 'Enum#internal',
00023                 'flashvars' => 'Text',
00024                 'wmode' => 'Enum#window,transparent,opaque',
00025                 'name' => 'ID',
00026             )
00027         );
00028         $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed();
00029 
00030     }
00031 
00032 }
00033 
00034 // vim: et sw=4 sts=4