Is there a way to get the YouTube filter to leave the dimensions alone that are set when creating content? No matter what size we use, they always default back to 425 x 350. I know this is for security purposes but is there a workaround? I read this: http://htmlpurifier.org/docs/enduser-youtube.html but still can't figure out next steps. Any help would be appreciated...

Comments

ezyang’s picture

Status: Active » Fixed

Hey superflyman, check out the new %HTML.SafeObject and %Output.FlashCompat configuration options. They'll be on the default view instead of Filter.YouTube next release.

phoang’s picture

Doesn't work for me.Anyone knows how to solve this.

phoang’s picture

Status: Fixed » Active

Changing status to Active.

ezyang’s picture

Status: Active » Postponed (maintainer needs more info)

axlrose, I can’t debug your issue if you don’t give me more information. What versions of HTML Purifier and the Drupal module are you using? What are your inputs and outputs?

phoang’s picture

Thank you ezyang , I found my the answer from http://htmlpurifier.org/docs/enduser-youtube.html ,said that cannot change the width and height.

The width and height of the final YouTube movie cannot be adjusted. This is because I am lazy. If you really insist on letting users change the size of the movie, what you need to do is package up the attributes inside the span tag (along with the movie ID). It gets complicated though: a malicious user can specify an outrageously large height and width and attempt to crash the user's operating system/browser. You need to either cap it by limiting the amount of digits allowed in the regex or using a callback to check the number.

I hope that someone will submit a patch to change the width and height.

ezyang’s picture

Status: Postponed (maintainer needs more info) » Fixed

Hello axlrose,

You should try using the %HTML.SafeObject and %Output.FlashCompat configuration, which will permit resizing height and width.

phoang’s picture

Status: Fixed » Active

I tried but It didn't work.

ezyang’s picture

Hello axlrose,

What input did you try and what did HTML Purifier give back?

phoang’s picture

I'm trying to embed a youtube video with custom size. For example, 960 x 745 but HTML Purifier give me back the default width and height : 425 x 350 no matter what size I input.

I already tried on a clean install.
Drupal 6.19
HTML Purifier 2.3
HTML Purifier Library : 4.1.1

Here is the code that I input.

<object width="960" height="745"><param name="movie" value="http://www.youtube.com/v/iFiPANvxfDg?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/iFiPANvxfDg?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="960" height="745"></embed></object>
ezyang’s picture

Status: Active » Postponed (maintainer needs more info)

I forgot to add; did you turn *off* the YouTube filter?

phoang’s picture

If I turn off the Filter.Youtube, the video doesn't show up.
Can you give me your configurations ?

ezyang’s picture

Do you have any configuration in HTML.Allowed? (Unlike Filter.YouTube, SafeObject requires object and param to be allowed, as well as all of the attributes.)

phoang’s picture

No. I left everything as default. It checked on Null/Disable at HTML.Allowed.

ezyang’s picture

This might be this issue: http://htmlpurifier.org/phorum/read.php?2,4794

What happens if you turn on SafeEmbed?

phoang’s picture

If I turn on SafeEmbed the youtube videos doesn't show up.

albert9000’s picture

Warning: Deprecated in favor of %HTML.SafeObject and %Output.FlashCompat (turn both on to allow YouTube videos and other Flash content).

http://htmlpurifier.org/live/configdoc/plain.html#Filter.YouTube

Also, disable The YouTube filter.

Don't forget to clear the HTML purifier cache.

ezyang’s picture

Status: Postponed (maintainer needs more info) » Fixed

Well, I guess we'll all just use iframes now... See #711728: SafeIframe configuration for images, google maps, and videos

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.