Ticket #2363 (closed Bug: fixed)

Opened 6 years ago

Last modified 6 years ago

IE7 Local Filesystem Permission Denied

Reported by: samuelms Owned by: fredck
Priority: Normal Milestone: FCKeditor 2.6.3
Component: General Version: FCKeditor 2.6.2
Keywords: IE Review+ Cc: samuel_smith@…

Description

This error occurs when loading a document into the fckeditor when running the editor from the filesystem. I am noticing that this error only occurs with very large files. I have a 288 KB html file (which unfortunately I cannot share) that causes this error to appear. Smaller files open in the editor just fine however.

I am setting the text of this file using the function

function SetHTML(html) {

var oEditor = FCKeditorAPI.GetInstance('FCKeditor1'); oEditor.SetHTML(html, true);

};

where the html value passed in has the contents of the body of the page to be edited.

I cannot reproduce this error on the demo or on the latest demo. I tried to reproduce it by opening the source view, pasting in my code, and going back to the wysiwyg view.

I have isolated the problem (when it occurs for me) to the fckeditor/editor/_source/internals/fckdocumentprocessor.js file. Here are my changes to get it to work properly for me.

(starts around line 145)

return FCKTools.Merge( FCKDocumentProcessor.AppendNew(),

{

ProcessDocument : function( doc ) {

Firefox 3 would sometimes throw an unknown exception while accessing EMBEDs and OBJECTs without the setTimeout(). FCKTools.RunFunction( function()

{

/*

  • My Change: Removed because access to the doc is being denied in
  • IE7 when loaded from local filesystem * *

Process OBJECTs first, since EMBEDs can sometimes go inside OBJECTS (e.g. Flash). var aObjects = doc.getElementsByTagName( 'object' ); for ( var i = aObjects.length - 1 ; i >= 0 ; i-- )

processElement( aObjects[i] ) ;

Now process any EMBEDs left. var aEmbeds = doc.getElementsByTagName( 'embed' ) ; for ( var i = aEmbeds.length - 1 ; i >= 0 ; i-- )

processElement( aEmbeds[i] ) ;

*

  • End of my changes

*/

} ) ;

},

I just commented out the logic that was happening. For whatever reason access to the doc variable was denied. Trying to access any variable inside the doc variable causes a permission denied error.

Attachments

2363.patch (2.3 KB) - added by fredck 6 years ago.

Change History

Changed 6 years ago by fredck

comment:1 Changed 6 years ago by fredck

  • Keywords HasPatch added

I was not able to reproduce this problem, but something similar has been already reported to me twice. All reports point to the same piece of code.

The code there states that the RunFunction function is used because of Firefox 3. So, the patch proposes to use it for Firefox only. Other browsers will call the code directly.

I've also refactored the code to avoid duplication.

@samuelms, can you confirm that this patch solves the problem to you?

comment:2 Changed 6 years ago by fredck

  • Owner set to fredck
  • Keywords Review? added; HasPatch removed
  • Status changed from new to assigned

It looks like the proposed patch is the real fix for it.

I'm asking for review. Even if not able to reproduce the problem, the reviewer should be focused on the syntax of the fix, as well as check any collateral issue that could come out because of it.

comment:3 Changed 6 years ago by samuelms

  • Keywords Review added; Review? removed
  • Status changed from assigned to closed
  • Resolution set to fixed
  • Cc samuel_smith@… added

I applied the patch and cannot duplicate the error. I opened the offending file (which always used to cause the error to come up) and no error appeared.

I will report if I notice any strange behavior, but the patch is working great for me.

I really appreciate how quickly bugs get fixed! :)

comment:4 Changed 6 years ago by fredck

  • Keywords IE Review? added; Review removed
  • Status changed from closed to reopened
  • Resolution fixed deleted

@samuelms, thanks for the check. This is quite important for us as you are the reporter for this ticket.

But the patch must be also reviewed by a "reviewer" to then finally land our SVN trunk. Check out the Ticket Life Cycle page for more information.

comment:5 Changed 6 years ago by martinkou

  • Keywords Review+ added; Review? removed

Looks ok to me.

comment:6 Changed 6 years ago by fredck

  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed with [2247].

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy