我使用此配置:
$config = HTMLPurifier_Config::createDefault();
$config->set('Core.Encoding', 'UTF-8');
$config->set('HTML.Doctype', 'XHTML 1.0 Strict');
$config->set('HTML.SafeObject', true);
$config->set('Output.FlashCompat', true);
$config->set('HTML.Allowed', 'object[width|height|data],param[name|value],embed[src|type|allowscriptaccess|allowfullscreen|width|height|wmode]');
$purifier = new HTMLPurifier($config);
但是像这样的所有嵌入标签都被剥离了:
<embed allowfullscreen="true" height="480" src="apps/viral_player/player-viral.swf?file=../../data/media/video/1.flv" width="720" wmode="transparent"></embed>
有没有办法让HTMLPurifier不剥离嵌入标签?
答案 0 :(得分:3)
试试HTML.SafeEmbed?