Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2115 closed Bug (fixed)

Permission denied to get property window.OnUploadCompleted

Reported by: wwalc Owned by: wwalc
Priority: High Milestone: FCKeditor 2.6.1
Component: File Browser Version: FCKeditor 2.6
Keywords: Confirmed Cc:

Description

Source: http://www.fckeditor.net/forums/viewtopic.php?f=6&t=9242

I use FCkeditor 2.6Rc in Ubuntu FIrefox 2.0.0.13, when i upload a image file, i get error message in browser error console "Error: uncaught exception: Permission denied to get property Window.OnUploadCompleted",

but when checked the upload dir in my server, the image has been actually uploaded successfully.

Attachments (4)

2115.patch (3.4 KB) - added by wwalc 8 years ago.
2115_2.patch (3.9 KB) - added by wwalc 8 years ago.
Same as 2115, added whatsnew entry.
2115_3.patch (13.5 KB) - added by wwalc 8 years ago.
2115_4.patch (15.1 KB) - added by wwalc 8 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 8 years ago by wwalc

  • Keywords Confirmed added
  • Milestone set to FCKeditor 2.6.1
  • Owner set to wwalc
  • Priority changed from Normal to High

Changed 8 years ago by wwalc

comment:2 Changed 8 years ago by wwalc

  • Keywords Review? added

Comment: since we will call window.parent.OnUploadCompleted anyway, let's use it to test if we can access a parent property.

Changed 8 years ago by wwalc

Same as 2115, added whatsnew entry.

comment:3 Changed 8 years ago by alfonsoml

  • Keywords Review- added; Review? removed

I haven't tested the patch, but I think that instead of keeping all that javascript, the code provided in [1799] should be used (I mean, a minimized version), and update that file to reflect the adjustment.

Changed 8 years ago by wwalc

comment:4 Changed 8 years ago by wwalc

  • Keywords Review? added; Review- removed

comment:5 Changed 8 years ago by fredck

  • Keywords Review- added; Review? removed

The only fault for me is that it is checking for window.parent.OnUploadCompleted in _dev/domain_fix_template.js, which should be a quite generic code instead.

I think the original problem is that we were using window.top.opener... so maybe checking "window.parent.document.domain" should work in the same way as "window.parent.OnUploadCompleted", but without impacting on the code generality.

I'm reviewing- it just to check this approach, otherwise everything sounds good.

comment:6 Changed 8 years ago by fredck

  • Summary changed from Ubuntu - Permission denied to get property Window.OnUploadCompleted to Permission denied to get property window.OnUploadCompleted

Removing "Ubuntu" from the subject, as it seems this one is impacting all browsers and installations as of FCKeditor 2.6.

Changed 8 years ago by wwalc

comment:7 Changed 8 years ago by wwalc

  • Keywords Review? added; Review- removed

The patched added above does the same thing as the previous one, but uses "window.parent.document.domain" in a loop to detect the correct domain.

There is another thing that is fixed in this patch. #1919 broke one thing. It seems that is impossible to use the standalone file browser, if we open it in the new window in Firefox (worked fine until 2.6 beta). Also the domain relaxation itself is broken in Firefox. To check this, simply open file browser:

http://dev.fckeditor.local/fckeditorsvn/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/fckeditorsvn/editor/filemanager/connectors/php/connector.php

note that if you change the name of a domain from dev.fckeditor.net to localhost, it will start working.

Adding break in frmactualfolder.html, browser.html, common.js seems to solve problem introduced in #1919. Interesting that adding the same break in the catch block in server connectors is causing errors. I don't understand exatcly what's going on here, but with this patch everything seemed to work fine. I haven't tested it deeply yet, unfortunately.

comment:8 Changed 8 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:9 follow-up: Changed 8 years ago by fredck

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

I've committed the patch for the urgent 2.6.1 release to happen today.

Fixed with [2059]. Click here for more info about our SVN system.

comment:10 Changed 8 years ago by martinkou

  • Keywords Review+ removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Adding break in the catch blocks of frmactualfolder.html, browser.html and common.js actually disabled the domain relaxation logic in the three files. And it is causing permission denied errors when a file is being clicked in the file browser.

comment:11 Changed 8 years ago by fredck

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

@martinkou, please open a new ticket for this issue. This one has already been fixed, closed and released.

comment:12 in reply to: ↑ 9 ; follow-up: Changed 8 years ago by mxm

  • Component changed from File Browser to Server : ASP.Net
  • Milestone changed from FCKeditor 2.6.1 to FCKeditor 2.6.4
  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to fredck:

I've committed the patch for the urgent 2.6.1 release to happen today.

Fixed with [2059]. Click here for more info about our SVN system.

Please, change the line 118 in the FileWorkerBase.cs! It is aspx-connector and it should be like asp-connector:

			Response.Write( @"(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();" );

comment:13 in reply to: ↑ 12 Changed 8 years ago by fredck

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

Replying to mxm:

Please, change the line 118 in the FileWorkerBase.cs! It is aspx-connector and it should be like asp-connector:

Same thing here... please open a dedicated ticket for it, explaining the current problem and how to solve it.

comment:14 Changed 8 years ago by fredck

  • Component changed from Server : ASP.Net to File Browser
  • Milestone changed from FCKeditor 2.6.4 to FCKeditor 2.6.1
Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy