2008-06-10 00:13:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes default type for all objects. Currently only supports flash.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_AttrTransform_SafeObject extends HTMLPurifier_AttrTransform
|
|
|
|
{
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @type string
|
|
|
|
*/
|
2008-06-19 21:24:50 +00:00
|
|
|
public $name = "SafeObject";
|
2008-06-10 00:13:44 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param array $attr
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
* @param HTMLPurifier_Context $context
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function transform($attr, $config, $context)
|
|
|
|
{
|
|
|
|
if (!isset($attr['type'])) {
|
|
|
|
$attr['type'] = 'application/x-shockwave-flash';
|
|
|
|
}
|
2008-06-10 00:13:44 +00:00
|
|
|
return $attr;
|
|
|
|
}
|
|
|
|
}
|
2008-12-06 09:24:59 +00:00
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|