Ticket #359 (closed Bug: fixed)

Opened 20 months ago

Last modified 19 months ago

IE Stripping Object Tag

Reported by: mcgovern@… Owned by:
Priority: Normal Milestone: FCKeditor 2.4.3
Component: General Version: SVN
Keywords: SF Confirmed IE Cc:

Description

I am experiencing a problem with FCKeditor while using IE 6. If I load HTML into the editor that contains an object tag with an embed tag (see sample below), the editor strips out the object tag completely. However, the embed tag remains. This does not happen in other browsers. Here is the code I am using.

<object id="audio" width="0" height="0">
<param name="console" value="AudioPlayer">
<param name="controls" value="audioWindow">
<param name="autostart" value="true">
<param name="src" value="YOUR_AUDIO_FILENAME_HERE">
<embed name="audio" width="0" height="0" src="YOUR_AUDIO_FILENAME_HERE"
console="AudioPlayer" controls="audioWindow" autostart="true">
</embed></object>

This only happens when reading the HTML into the editor initially. If I cut and paste this code into the editor and stay in source mode, it is not altered, until after I save it to the server and re-load into the editor. At this point it is still correct on the server, but changed in the editor. If I then save it again, the changed version is saved. If I cut and paste this code into the editor but leave source mode before saving, it is changed. The end result seems to always be stripping out the object tag.


Moved from SF:
https://sourceforge.net/tracker/index.php?func=detail&aid=1661658&group_id=75348&atid=543653

Change History

Changed 20 months ago by fredck

  • reporter changed from fredck to mcgovern@…

Changed 20 months ago by fredck

  • keywords Confirmed IE added
  • version changed from FCKeditor 2.4 to SVN
  • milestone set to FCKeditor 2.5

Confirmed with IE6. Ok with FF2.

The problem here is that IE has a terrible DOM tree... let me try to explain.

If a <object> tag can't be load for any reason, it is completely ignored in the DOM tree (<param> elements too), and its contents are rendered instead.

In your example, the <object> element is missing the required "classid" attribute, being not valid. So the <object> element is ignored and only <element> goes to the DOM.

So, it seams that the only feasible solution is to protect the <object> tags in WYSIWYG mode, displaying them only in the source. For this, just add the following to the configuration file:

FCKConfig.ProtectedSource.Add( /<object[\s|\S]+?<\/object>/gi ) ;

We'll be much probably handle this internally in the editor code, not requiring it to be included in the configuration file. So, I'm leaving this ticket opened until the fix is not available.

Changed 19 months ago by fredck

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from FCKeditor 2.5 to FCKeditor 2.4.3

Fixed with [327].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.