Re: Safely Allow Embedded Media on User Pages

Alex Wayne
Sat, 04 Nov 2006 08:08:21 -0000

Andrew Kortina wrote:
> Hi,
>
> I''m working on allowing users of my website to embed media from
places
> like YouTube, Flickr, Google Video, Slide.com, etc. into their home
> pages, but I wanted to know if anyone had suggestions or links to good
> articles about how to make sure the embedded content is cleaned / safe.
>
> One thing that came to mind was to regular expression check against each
> type of embedded media. Seems like this would probably be the safest
> route,  but that would be quite tedious to do for every possible source.
>
> Please let me know if you have any ideas, snippets, suggestions, or
> links.  Thanks.
>
> --kortina

simply get the video ID, and then construct the html yourself.  You can
probably use a regex to extract the ID from the embed code, and then
reconstruct the safe HTML without a problem.

--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---