Форуми / Cotonti / General / Siena: Youtube embedding vs. HTMLPurifier

JIabs
#1 17.04.2011 13:47

 

First of all, I’m sorry for my bad English. I have a question about Youtube (and other video and media content hosting) support in Siena (with CKEditor as default WISIWIG-Editor).

I’m trying to insert an <iframe> into the message, but it seems to be blocked by the rule of HTMLPurifier.

I know there is the youtube-filter in the default package, and it works fine with the <object>-tag, but the message (I mean the video-object attributes) can’t be modified anymore in the WISIWIG-mode, after I save the message. Only in the Source-Mode, it’s better than nothing at all, but still uncomfortable. And the <object> is not the default way for video embedding (youtube supports it, but <iframe> is default if I click "share video").

I know it's not safe to allow <ifame> on the site, but these rights will have only administrators and supermoderators.

I have already found a plugin for the CKEditor. This Plugin allows me to insert an iframe-code of youtube fast and easy, and to edit it by the right mouse button.

It’s really difficult for me to create my own filter for the HTMLPurifier. If someone have the same problem or have an idea, please explain how can I get it work.

Thank you.

Added 21 hours later:

found a solution, that allows to insert iframe tag in the message(vimeo, youtube and other videos are working fine with these settings). Make sure, only trusted users and administrators of your site can have such permissions!

http://htmlpurifier.org/phorum/read.php?3,4646

 


Відредаговано: JIabs (18.04.2011 10:23, 12 років тому)
Macik
#2 07.12.2012 12:19

First of all, there are related topics:

http://www.cotonti.com/forums?m=posts&p=25995
http://www.cotonti.com/forums?m=posts&p=31340

By default (in Cotonti with CKEditor), you can embed youtube video with inserting object tag via «flash» button, like this:

<object width="425" height="350" type="application/x-shockwave-flash" 
data="http://www.youtube.com/code">
<param name="movie" value="http://www.youtube.com/code"></param>
<!--[if IE]>'.
<embed src="http://www.youtube.com/code'
type="application/x-shockwave-flash"
wmode="transparent" width="425" height="350" />
<![endif]-->
</object>

See it on screenshot: http://screenshot.galaxyhost.org/img/20121207-s00-48kb.jpg  (sorry for russian descriptions, but I think able to understand picture with dialog)

 

 

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F