Help with code stripping and Joomla and JCE

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
papershark
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Aug 21, 2009 5:29 pm

Help with code stripping and Joomla and JCE

Post by papershark » Fri Sep 18, 2009 5:15 pm

Version 1.5.14
Ok, i have sort of figured this one out for myself, but it's a work around and it doesn't really help with my clients.

The JCE editor is stripping code in a way that i am failing to understand. If i set the editor to MCE i can get so that a use can add code to their blog post... such as [youtube] video object like this.

Code: Select all

<object width="425" height="344"><param name="movie" value="http://www.[youtube].com/v/Wvo-g_JvURI&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.[youtube].com/v/Wvo-g_JvURI&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
The JCE editor will strip it to this... and no movie will show up in the blog post.

Code: Select all

<param name="movie" value="http://www.[youtube].com/v/Wvo-g_JvURI&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
I have reached a point of understanding with the updated PARAMETERS in the media manager.. and how to control which users can install code. I can set these parameters so if the [youtube] object code is added... it is not effected. switch back to JCE... and arbitrary (as far as i can figure) code rewriting.



please note: the edit your code in html (no editor) is fine for me... but it is not really an option for people i have set up a Joomla site.

Any experience you can share or documentation about JCE code stripping, how it works and how to stop it will be appreciated. it is causing me some confusion.

also.... does anyone know a good open source code wysiwyg editor that plays ball a little better on these matters. i used to really like JCE but this coupled with the fact mediamanager was spirited away in the middle of the night has worn me a little thin.

User avatar
GoodTimesJeff
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Jul 06, 2009 7:34 pm
Contact:

Re: Help with code stripping and Joomla and JCE

Post by GoodTimesJeff » Thu Nov 12, 2009 11:34 pm

Hi I am having the same issue, Hove found the JoomlaWorks All Video plug in to work, but only in item view, not section or category view http://www.joomlaworks.gr/content/view/16/42/
My Best regards, GoodTimesJeff http://www.goodtimessantacruz.com

papershark
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Aug 21, 2009 5:29 pm

Re: Help with code stripping and Joomla and JCE

Post by papershark » Fri Nov 13, 2009 12:42 pm

Many thanks for your help. i will Joomla works a look

Hi there. this discussion migrated to this thread.
http://forum.joomla.org/viewtopic.php?f ... 7#p1856717

unfortunately this is a known issue with joomla at the moment.

It is very frustrating i know! but it is a known bug that is driving people crazy.

as the moment i have set up another administrator account that is 'NO-Editor'
and put the code in by hand. Google-code have some good documentation about it that i always refer to.

http://code.google.com/p/swfobject/wiki/documentation

however all this is kind of academic when i want to set up a site where a customer can just drop some copy/pasta [youtube] code in.

Jerome123
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 119
Joined: Tue Jan 27, 2009 1:35 pm

Re: Help with code stripping and Joomla and JCE

Post by Jerome123 » Fri Dec 04, 2009 12:50 pm

Hey there,

I got kind of similar problem, i am using jce 1.57 component and 1.5.6 plugin.
I cannot insert specific code such as ../ to find the right path for my images or just / as when i update it will just strip out that bit of code.

Please does somebody know whats going on??

Thanks for any help.

Regards,

Jerome

craigcjc
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Feb 01, 2008 11:47 pm

Re: Help with code stripping and Joomla and JCE

Post by craigcjc » Wed Dec 09, 2009 11:29 pm

We had the same problem and the only solution we found was to replace in the plugins folder the tinymce editor folder plus the xml file with an earlier version of tinymce. The one that came out with earlier versions of Joomla say around 1.5
Earlier versions of Joomla can still be downloaded from the Joomla site.

Keep the files that you are replacing though in case you need to put them back.

Remmebr backup everything before doing this.

Jerome123
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 119
Joined: Tue Jan 27, 2009 1:35 pm

Re: Help with code stripping and Joomla and JCE

Post by Jerome123 » Thu Dec 10, 2009 6:48 am

Thanks craigcjc,

Ill check it out in a mom, the only solution that works for me is to have the full path to the images.

Thanks again for your reply.

Regards

Jerome

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Sat Dec 12, 2009 7:26 pm

I am having no luck with this..

I have turned off MCE and JCE and its still stripping out the HTML

Jerome123
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 119
Joined: Tue Jan 27, 2009 1:35 pm

Re: Help with code stripping and Joomla and JCE

Post by Jerome123 » Mon Dec 14, 2009 6:58 am

Have you try typing the whole url : http://website/images/etc...

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Mon Dec 14, 2009 11:58 am

Jerome123 wrote:Have you try typing the whole url : http://website/images/etc...
It doesn't strip URL..

It strips anything with an <html> tag.. or an <object> tag..

craigcjc
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Feb 01, 2008 11:47 pm

Re: Help with code stripping and Joomla and JCE

Post by craigcjc » Mon Dec 14, 2009 7:32 pm

Try this, open tiny mc editor preferences and click on code cleanup on save always, then go to article manager and make sure that everything except administrator is set to blacklist.

You may still have problems with object tags but it should retain the html.

I used to turn off the editor in the configuration and put the code in save then close the window and turn the editor back on and it retained the html and tags.

Ill do some more digging on the editor problem.

User avatar
donmarvin
Joomla! Explorer
Joomla! Explorer
Posts: 379
Joined: Sat Mar 04, 2006 2:27 pm
Location: New York
Contact:

Re: Help with code stripping and Joomla and JCE

Post by donmarvin » Mon Dec 14, 2009 7:36 pm

I used to turn off the editor in the configuration and put the code in save then close the window and turn the editor back on and it retained the html and tags.
Yeah, I don't like doing it that way because it can be dangerous -- everyone editing the site has to remember that the article can't be opened until you switch editors.
http://www.iTeachMe.com
Online Learning System for Joomla!(R)

craigcjc
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Feb 01, 2008 11:47 pm

Re: Help with code stripping and Joomla and JCE

Post by craigcjc » Mon Dec 14, 2009 7:47 pm

Just found this.


WYSIWYG editor removes HTML code

Written by Peter Martin Friday, 13 February 2009

With the "Edit HTML Source" option of your WYSIWYG editor you can put HTML code in your article. However the HTML code will be stripped upon saving. Unless ...

Even if you use the no WYSIWYG ( "Editor - No Editor") which can be set in Global Configuration and/or the parameters of your user account in the User Manager.

To prevent Joomla from stripping HTML from your content (Note: handle with care):

1. Goto the Article Manager.
2. Select "Parameters" (the button on the top right).
3. Under Filtering options, choose:
Filter groups: select the groups that are allowed to use HTML code, e.g. SuperAdministrator
Filter type: Whitelist

Now you can use HTML in your articles (with "Edit HTML Source" option).

User avatar
donmarvin
Joomla! Explorer
Joomla! Explorer
Posts: 379
Joined: Sat Mar 04, 2006 2:27 pm
Location: New York
Contact:

Re: Help with code stripping and Joomla and JCE

Post by donmarvin » Mon Dec 14, 2009 8:00 pm

Yeah, but that's what JCE is for -- to have more granular control over the html than you do with Joomla's standard editors.
http://www.iTeachMe.com
Online Learning System for Joomla!(R)

craigcjc
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Feb 01, 2008 11:47 pm

Re: Help with code stripping and Joomla and JCE

Post by craigcjc » Mon Dec 14, 2009 8:07 pm

Do you recommend using JCE as I have not installed it yet?

User avatar
donmarvin
Joomla! Explorer
Joomla! Explorer
Posts: 379
Joined: Sat Mar 04, 2006 2:27 pm
Location: New York
Contact:

Re: Help with code stripping and Joomla and JCE

Post by donmarvin » Mon Dec 14, 2009 8:38 pm

Absolutely, I recommend it! If you have multiple users with WYSIWYG access it's a must-have so you can control what each user or usergroup can use in their editor.
http://www.iTeachMe.com
Online Learning System for Joomla!(R)

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Tue Dec 15, 2009 6:46 pm

Joomla is still stripping the code..

whether its done in the default wyswyg editor, tinymce or jce..

all of them have the html stripped out.

damn frustrating.

cmck0846
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Nov 08, 2009 12:38 pm

Re: Help with code stripping and Joomla and JCE

Post by cmck0846 » Fri Jan 15, 2010 1:57 am

Did u figure this out i got a swf video code i can't get to work -
<embed src="http://www.wfn.tv/includes/swf/player-embed.swf" width="480" height="290" allowscriptaccess="always" allowfullscreen="true" bgcolor="#000" flashvars="file=flash/wfn/wfnnews/.uid.ManBAADcqnljE_7g6Ae74878332441d028698a2f6f9fdb90ac.kurita_record_bass&streamer=rtmp://cp49576.edgefcs.net/ondemand/&type=rtmp&autostart=true&backcolor=faa91c" />
- turns it to -
<img title=""flashvars":"file%3Dflash%2Fwfn%2Fwfnnews%2F.uid.ManBAADcqnljE_7g6Ae74878332441d028698a2f6f9fdb90ac.kurita_record_bass%26streamer%3Drtmp%3A%2F%2Fcp49576.edgefcs.net%2Fondemand%2F%26type%3Drtmp%26autostart%3Dtrue%26backcolor%3Dfaa91c","src":"http://www.wfn.tv/includes/swf/player-e ... een":"true"" style="background-color: #000000;" src="plugins/editors/jce/tiny_mce/plugins/media/img/trans.gif" height="290" width="480" />
- coming from - http://www.wfn.tv/video/video.php?video=401984
- i got it on my site here -
http://www.fishingfanaticsonline.com/in ... &Itemid=58

thanks for any help.

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Fri Jan 15, 2010 10:56 pm

I am still having to update all html code via phpadmin.. none of it works in Joomla.. and I can't get an answer here or at Joomlacontenteditor.com

User avatar
donmarvin
Joomla! Explorer
Joomla! Explorer
Posts: 379
Joined: Sat Mar 04, 2006 2:27 pm
Location: New York
Contact:

Re: Help with code stripping and Joomla and JCE

Post by donmarvin » Sat Jan 16, 2010 12:18 am

I am still having to update all html code via phpadmin.. none of it works in Joomla.. and I can't get an answer here or at Joomlacontenteditor.com
Which tags do you need that are getting stripped?
http://www.iTeachMe.com
Online Learning System for Joomla!(R)

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Sat Jan 16, 2010 12:41 am

I find that any script, object, embed code gets stripped.

User avatar
donmarvin
Joomla! Explorer
Joomla! Explorer
Posts: 379
Joined: Sat Mar 04, 2006 2:27 pm
Location: New York
Contact:

Re: Help with code stripping and Joomla and JCE

Post by donmarvin » Sat Jan 16, 2010 1:38 am

For embedding a swf object, use AVReloaded or another video player plugin.

You cannot enter php or javascript code into an article. You would need to add this type of code via a plugin.
http://www.iTeachMe.com
Online Learning System for Joomla!(R)

kennibc
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue Jun 09, 2009 1:54 pm

Re: Help with code stripping and Joomla and JCE

Post by kennibc » Mon Feb 01, 2010 7:50 pm

I am having this issue as well with the <embed> tag from a website not supported by allvideos.

Code: Select all

<embed src="http://video.dearbornschools.org/flvplayer.swf" width="320" height="256" bgcolor="FFFFFF" allowscriptaccess="always" allowfullscreen="false" wmode="transparent" flashvars="file=http://video.dearbornschools.org/uploads/fcTzx0vhAN2eTpWpElN2.flv&image=http://video.dearbornschools.org/uploads/player_thumbs/fcTzx0vhAN2eTpWpElN2.jpg&backgcolor=FFFFFF&stretching=fill&skin=http://video.dearbornschools.org/skins/Snel.swf&autostart=true&fullscreen=&logo=http://video.dearbornschools.org/images/playerlogos/logo-player.png&icons=false&link=http://video.dearbornschools.org/videos/1011/attack-the-math-5&linktarget=_self&displayclick=link"></embed>
Joomla or JCE strips it down to an img tag:

Code: Select all

<img title=""flashvars":"file%3Dhttp%3A%2F%2Fvideo.dearbornschools.org%2Fuploads%2FfcTzx0vhAN2eTpWpElN2.flv%26image%3Dhttp%3A%2F%2Fvideo.dearbornschools.org%2Fuploads%2Fplayer_thumbs%2FfcTzx0vhAN2eTpWpElN2.jpg%26backgcolor%3DFFFFFF%26stretching%3Dfill%26skin%3Dhttp%3A%2F%2Fvideo.dearbornschools.org%2Fskins%2FSnel.swf%26autostart%3Dtrue%26fullscreen%3D%26logo%3Dhttp%3A%2F%2Fvideo.dearbornschools.org%2Fimages%2Fplayerlogos%2Flogo-player.png%26icons%3Dfalse%26link%3Dhttp%3A%2F%2Fvideo.dearbornschools.org%2Fvideos%2F1011%2Fattack-the-math-5%26linktarget%3D_self%26displayclick%3Dlink","src":"http://video.dearbornschools.org/flvplayer.swf","wmode":"transparent","allowfullscreen":"false"" src="plugins/editors/jce/tiny_mce/plugins/media/img/trans.gif" height="256" width="320" />
Any suggestions? This is frustrating because it worked up until I updated the JCE editor to 1.5.7 & 1.5.6.

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Thu Feb 04, 2010 10:00 am

Ken, really, its a joke.

As far as I can tell, the Joomla core team is too focused on J!1.6 to care about Joomla J!1.5 anymore.

Same with the JCE..

kennibc
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue Jun 09, 2009 1:54 pm

Re: Help with code stripping and Joomla and JCE

Post by kennibc » Thu Feb 04, 2010 2:55 pm

Actually I just found the answer. The embed code needs to include the "type" parameter. Then it works just fine.

Not ideal, but it is now working.

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Sun Feb 07, 2010 1:29 pm

kennibc wrote:Actually I just found the answer. The embed code needs to include the "type" parameter. Then it works just fine.

Not ideal, but it is now working.
Can you explain and detail please ?

kennibc
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue Jun 09, 2009 1:54 pm

Re: Help with code stripping and Joomla and JCE

Post by kennibc » Mon Feb 08, 2010 2:47 pm

pmcnamara wrote:Can you explain and detail please ?
In the embed code above, you have to add this parameter to the code prior to saving the document:

Code: Select all

type="application/x-shockwave-flash"
Example Original:

Code: Select all

<embed src="http://video.dearbornschools.org/flvplayer.swf" width="320" height="256" bgcolor="FFFFFF" allowscriptaccess="always" allowfullscreen="false" wmode="transparent" flashvars="file=http://video.dearbornschools.org/uploads/fcTzx0vhAN2eTpWpElN2.flv&image=http://video.dearbornschools.org/uploads/player_thumbs/fcTzx0vhAN2eTpWpElN2.jpg&backgcolor=FFFFFF&stretching=fill&skin=http://video.dearbornschools.org/skins/Snel.swf&autostart=true&fullscreen=&logo=http://video.dearbornschools.org/images/playerlogos/logo-player.png&icons=false&link=http://video.dearbornschools.org/videos/1011/attack-the-math-5&linktarget=_self&displayclick=link"></embed>
Example FIXED****

Code: Select all

<embed src="http://video.dearbornschools.org/flvplayer.swf" type="application/x-shockwave-flash" width="320" height="256" bgcolor="FFFFFF" allowscriptaccess="always" allowfullscreen="false" wmode="transparent" flashvars="file=http://video.dearbornschools.org/uploads/fcTzx0vhAN2eTpWpElN2.flv&image=http://video.dearbornschools.org/uploads/player_thumbs/fcTzx0vhAN2eTpWpElN2.jpg&backgcolor=FFFFFF&stretching=fill&skin=http://video.dearbornschools.org/skins/Snel.swf&autostart=true&fullscreen=&logo=http://video.dearbornschools.org/images/playerlogos/logo-player.png&icons=false&link=http://video.dearbornschools.org/videos/1011/attack-the-math-5&linktarget=_self&displayclick=link"></embed>

kennibc
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue Jun 09, 2009 1:54 pm

Re: Help with code stripping and Joomla and JCE

Post by kennibc » Mon Feb 08, 2010 2:50 pm

Notice the FIXED*** contains the 'type' parameter right after the 'src' parameter.
We are using PHPMotion to store and create a video sharing website. I am modifying the template that generates the EMBED code to now include the type parameter so that I do not have to add it by hand everytime I want to embed a video into our Joomla website.

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Mon Feb 08, 2010 3:24 pm

Ken, THANK YOU !! Leave it to a fellow Michigander to have the right answer !!

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Help with code stripping and Joomla and JCE

Post by pmcnamara » Tue Feb 09, 2010 12:35 am

worked for the object code, but not the java code..

This is what I inputed..

Code: Select all

<script type='text/javascript' src='swfobject.js'></script>
 
<div id='mediaspace'>This text will be replaced</div>
 
<script type='text/javascript'>
  var so = new SWFObject('player.swf','mpl','470','290','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','bunny.flv');
  so.addVariable('screencolor','660066');
  so.addVariable('streamer','rtmp://edge01.fms.dutchview.nl/botr');
  so.write('mediaspace');
</script>
But once I clicked save, this is what was left...

Code: Select all

<div id="mediaspace">This text will be replaced</div>
var so = new SWFObject('player.swf','mpl','470','290','9');     so.addParam('allowfullscreen','true');     so.addParam('allowscriptaccess','always');     so.addParam('wmode','opaque');     so.addVariable('file','bunny.flv');     so.addVariable('screencolor','660066');     so.addVariable('streamer','rtmp://edge01.fms.dutchview.nl/botr');     so.write('mediaspace');​​​

User avatar
lividsnails
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 124
Joined: Mon Jan 07, 2008 4:46 pm

Re: Help with code stripping and Joomla and JCE

Post by lividsnails » Mon Apr 26, 2010 8:46 pm

I think this is what is causing my problem. We have a PayPal donate button in one article on our site. If someone edits that article through the front end, something happens and the code changes from this, which works:

Code: Select all

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="...">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
to this, which doesn't work:

Code: Select all

<form method="post"> 
<input name="cmd" value="_s-xclick" type="hidden" /> 
<input name="hosted_button_id" value="..." type="hidden" /> 
<input src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" border="0" type="image" /> 
<img src="https://www.paypal.com/en_US/i/scr/pixel.gif" border="0" height="1" width="1" /> 
</form>
I can't figure out how to keep this from happening. I've tried the ideas offered above. Using the filter thing didn't work. Note this ONLY happens when editing the article from the front end, not from the administrative end, even though both use the same editor (JCE). I also tried other editors. Same result. Edit the article through the front end and the code gets changed and the button doesn't work.

Can anyone help?


Locked

Return to “Extensions for Joomla! 1.5”