Yii version:1.1.13 (just in case it matters)
I am trying to allow YouTube iFrame code in blog posts.
The YouTube iFrame code
What am I doing wrong?
Thanks.
I am trying to allow YouTube iFrame code in blog posts.
//Allow HTML target attribute and YouTube iFrame
$content = $data->content;
$p = new CHtmlPurifier();
$p->options = array(
'Attr.AllowedFrameTargets'=> array('_blank'),
'HTML.Allowed'=> 'p,a[href|target],strong,em,br',
'HTML.SafeIframe'=> true,
'URI.SafeIframeRegexp'=>'%^http://(www.youtube.com/embed/)%',
);
$content = $p->purify($content);
The YouTube iFrame code
<iframe width="560" height="315" src="http://www.youtube.com/embed/aXPP2SQuGSM?rel=0" frameborder="0" allowfullscreen></iframe>does not get rendered into the post.
What am I doing wrong?
Thanks.