friendica/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php

41 lines
1.1 KiB
PHP
Raw Normal View History

2010-09-08 23:14:17 -04:00
<?php
/**
* A "safe" embed module. See SafeObject. This is a proprietary element.
*/
class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
{
2016-02-09 05:06:17 -05:00
/**
* @type string
*/
2010-09-08 23:14:17 -04:00
public $name = 'SafeEmbed';
2016-02-09 05:06:17 -05:00
/**
* @param HTMLPurifier_Config $config
*/
public function setup($config)
{
2010-09-08 23:14:17 -04:00
$max = $config->get('HTML.MaxImgLength');
$embed = $this->addElement(
2016-02-09 05:06:17 -05:00
'embed',
'Inline',
'Empty',
'Common',
2010-09-08 23:14:17 -04:00
array(
'src*' => 'URI#embedded',
'type' => 'Enum#application/x-shockwave-flash',
'width' => 'Pixels#' . $max,
'height' => 'Pixels#' . $max,
'allowscriptaccess' => 'Enum#never',
'allownetworking' => 'Enum#internal',
'flashvars' => 'Text',
2016-02-09 05:06:17 -05:00
'wmode' => 'Enum#window,transparent,opaque',
2010-09-08 23:14:17 -04:00
'name' => 'ID',
)
);
$embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed();
}
}
// vim: et sw=4 sts=4