|
Re: Generic video/embed filter? March 09, 2010 06:17PM |
Registered: 3 years ago Posts: 18 |
|
Re: Generic video/embed filter? March 09, 2010 06:30PM |
Admin Registered: 6 years ago Posts: 2,638 |
Sorry; allowfullscreen should be allowed in %HTML.Trusted; but not allowed in %HTML.SafeObject. If your testing indicates otherwise there is probably a bug.
|
Re: Generic video/embed filter? March 10, 2010 11:39AM |
Registered: 3 years ago Posts: 18 |
|
rocker
Re: Generic video/embed filter?March 15, 2010 05:59AM |
Ambush Commander, please, give me advice. I want to allow "flashvars" param in tag. How I could do it? I don`t want big security in embed, i just want to allow this param, because its very important. I tried to modify AttrTransform\SafeEmbed.php, but as I understood, $attr already contains only allowed tags.. So, please give me some tip how to allow this param. Big thx.
|
Re: Generic video/embed filter? March 15, 2010 01:30PM |
Admin Registered: 6 years ago Posts: 2,638 |
Try the solution here: http://htmlpurifier.org/phorum/read.php?3,4324,4334#msg-4334
|
Curtis Gibby
Cannot set undefined directive Output.FlashCompatMarch 29, 2010 10:01AM |
After I download the latest dev version (2010-03-10) and try to output an embedded video (non-Youtube), I get the following warning:
Warning: Cannot set undefined directive Output.FlashCompat to value on line 10 in file /path/to/myfile.php in /path/to/htmlpurifier/library/HTMLPurifier/Config.php on line 564
Config code:
$config = HTMLPurifier_Config::createDefault();
$config->set('Output.TidyFormat', true);
$config->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype
$config->set('HTML.SafeObject', true);
$config->set('Output.FlashCompat', true);
$config->set('HTML.SafeEmbed', true);
That gives me an embed, but without the flashvars required to make the video work. I see other people are having success with HTML.SafeEmbed and Output.FlashCompat, but it seems that the version of the code that I have just doesn't recognize that FlashCompat exists. Any ideas?
|
Re: Cannot set undefined directive Output.FlashCompat March 29, 2010 10:41AM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Curtis Gibby
Re: Cannot set undefined directive Output.FlashCompatMarch 29, 2010 11:48AM |
|
Re: Cannot set undefined directive Output.FlashCompat March 29, 2010 11:54AM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Curtis Gibby
Re: Cannot set undefined directive Output.FlashCompatMarch 30, 2010 09:15AM |
Okay, I reuploaded the dev branch to my server and the Output.FlashCompat error went away. Thanks for helping me troubleshoot it.
Next issue: even with that fixed, my embed is still getting its flashvars stripped out. It's the generic embed code generated by the JW Player. I understand not allowing script access or fullscreen, but it needs its flashvars. Object-based embeds work fine. Any ideas?
Input :
<embed src='http://www.curtisgibby.com/pages/player-viral.swf' height='240' width='320' allowscriptaccess='always' allowfullscreen='true' flashvars='image=http%3A%2F%2Fwww.curtisgibby.com%2Fthumbs%2FEaster2009-NathanSwinging.jpg&file=http%3A%2F%2Fwww.curtisgibby.com%2Fpics%2FEaster2009-NathanSwinging.flv&plugins=viral-1d'/>
Output :
<embed src='http://www.curtisgibby.com/pages/player-viral.swf' height='240' width='320' allowscriptaccess='never' allownetworking='internal' type='application/x-shockwave-flash'>
Config :
$config = HTMLPurifier_Config::createDefault();
$config->set('Output.TidyFormat', true);
$config->set('HTML.Doctype', 'HTML 4.01 Transitional');
$config->set('HTML.SafeObject', true);
$config->set('HTML.SafeEmbed', true);
$config->set('Output.FlashCompat', true);
$purifier = new HTMLPurifier($config);
|
Re: Cannot set undefined directive Output.FlashCompat March 30, 2010 01:25PM |
Admin Registered: 6 years ago Posts: 2,638 |
Drop %HTML.SafeEmbed, it doesn't do the right thing. I guess we need to match embed tags and build up the entire thing. Marking this as a bug.
|
Re: Generic video/embed filter? March 30, 2010 01:34PM |
Admin Registered: 6 years ago Posts: 2,638 |
Ok, I fixed the flashvars in embed issue, though you'll still need %HTML.Embed on.
|
Curtis Gibby
Re: Generic video/embed filter?March 30, 2010 03:25PM |
|
Re: Generic video/embed filter? March 30, 2010 03:29PM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Curtis Gibby
Re: Generic video/embed filter?March 30, 2010 07:10PM |
Thanks, Edward.
I've updated my site with the latest "flashvars"-enabled code, but that parameter is still getting stripped out of my embed -- same results as before. (Both with and without %HTML.SafeObject enabled.) Can someone else confirm that a JW embed does work with the parameters described as above?
|
Re: Generic video/embed filter? March 31, 2010 12:17PM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Curtis Gibby
Re: Generic video/embed filter?April 01, 2010 08:14AM |
|
Todd Geist
Re: Generic video/embed filter?April 10, 2010 04:01PM |
Hello,
I have the latest version from git. I am using the drupal module. I have set SafeEmbed and SafeObject on. I have "Trusted" off. I also have FlashCompat on. I have cleared all caches.
But the embed tag is still getting stripped out.
Is there some other setting I need to deal with?
Thanks
Todd
|
Re: Generic video/embed filter? April 10, 2010 04:19PM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Todd Geist
Re: Generic video/embed filter?April 10, 2010 04:29PM |
well I am using the Drupal module, so I am guessing you want to see the code that I using, not my implementation code.
Here is it is
<embed allowfullscreen="true" allowscriptaccess="always" height="400" src="http://blip.tv/play/hb0hgdL%2BFQA%2Em4v" type="application/x-shockwave-flash" width="600"></embed>
Thanks
Todd
|
Re: Generic video/embed filter? April 10, 2010 04:39PM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Todd Geist
Re: Generic video/embed filter?April 10, 2010 04:57PM |
|
Re: Generic video/embed filter? April 10, 2010 05:04PM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Todd Geist
Re: Generic video/embed filter?April 10, 2010 05:21PM |
Turning "trusted" and "flashCompat" on or off in any combinatino has no effect.
If use " the object tag comes through but it is stripped of its parameters. Also embed is removed, but I have seen embed just be commented out for IE too, (not seeing that now)
before
<object height="385" width="480"><param name="movie" value="http://www.youtube.com/v/A_L8sW_ULH8&hl=en_US&fs=1&" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed allowfullscreen="true" allowscriptaccess="always" height="385" src="http://www.youtube.com/v/A_L8sW_ULH8&hl=en_US&fs=1&" type="application/x-shockwave-flash" width="480"></embed></object>
after
<object height="385" width="480" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><param name="movie" value="" /></object>
Todd
|
Todd Geist
Re: Generic video/embed filter?April 10, 2010 05:25PM |
|
Todd Geist
Re: Generic video/embed filter?April 10, 2010 05:33PM |
to recap... settings that are working for me.
SafeEmbed - "yes" SafeObject - "yes" Trusted - "No" DisableExternalResources - "No"
Drupal Module 6.x-2.1 (http://drupal.org/project/htmlpurifier) Latest git version from Tue, 30 Mar 2010 17:33:13 +0000
Finally - Drupal, CKeditor, IMCE and HTMLPurifier - all playing nice with one another!
Thanks very much for a nice bit o work!
Todd
|
Todd Geist
Re: Generic video/embed filter?April 10, 2010 05:36PM |
|
Re: Generic video/embed filter? April 10, 2010 05:41PM |
Admin Registered: 6 years ago Posts: 2,638 |
|
Re: Generic video/embed filter? June 15, 2010 03:41PM |
Registered: 3 years ago Posts: 18 |
|
Re: Generic video/embed filter? June 15, 2010 03:41PM |
Registered: 3 years ago Posts: 18 |
There's a bug on line 145 of the Generator when using FlashCompat for embed objects.
Once the
<!--[if IE]><![endif]-->
is included, each additional time the filter is run it will keep appending that string.
For example, if the filter is run 2x, this is the resulting code:
<object width="640" height="385"> <param name="movie" value="http://www.youtube.com/v/2mNB_VG_shc&hl=en_US&fs=1&" /> <param name="allowFullScreen" value="true" /> <param name="allowscriptaccess" value="always" /> <!--[if IE]><embed width="640" height="385" src="http://www.youtube.com/v/2mNB_VG_shc&hl=en_US&fs=1&" allowFullScreen="true" allowscriptaccess="always" /><![endif]--><!--[if IE]><embed width="640" height="385" src="http://www.youtube.com/v/2mNB_VG_shc&hl=en_US&fs=1&" allowFullScreen="true" allowscriptaccess="always" /><![endif]--> </object>