Hi,
function cleanComments($dirtyHtml)
{
// load the config and overide defaults as necessary
$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
$config->set('HTML.AllowedElements', 'a,em,blockquote,p,strong,pre,code');
$config->set('HTML.AllowedAttributes', 'a.href,a.title');
$config->set('Filter.YouTube', true);
$config->set('HTML.TidyLevel', 'light');
$htmlpurifier = new HTMLPurifier($config);
$cleanHtml = $htmlpurifier->purify($dirtyHtml);;
return $cleanHtml;
}
$html = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/BdU--T8rLns"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/BdU--T8rLns" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object><a>';
$html .= ' kkkk <a href="http://www.google.it/">pippo</a><p>pippo</p><em>ddd</em><div>pippo</div>';
echo(cleanComments($html));
Well I’m just waiting my you tube object
but I only get BdU–T8rLns
What’s the trouble ?
Bye