Ticket #2115 (closed Bug: fixed)

Opened 2 years ago

Last modified 18 months ago

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

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

Change History

  Changed 2 years ago by wwalc

  • keywords Confirmed added
  • owner set to wwalc
  • priority changed from Normal to High
  • milestone set to FCKeditor 2.6.1

Changed 2 years ago by wwalc

  Changed 2 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 2 years ago by wwalc

Same as 2115, added whatsnew entry.

  Changed 2 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 2 years ago by wwalc

  Changed 2 years ago by wwalc

  • keywords Review? added; Review- removed

  Changed 22 months 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.

  Changed 22 months 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 22 months ago by wwalc

  Changed 22 months 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.

  Changed 22 months ago by fredck

  • keywords Review+ added; Review? removed

follow-up: ↓ 12   Changed 21 months ago by fredck

  • status changed from new to closed
  • resolution set to fixed

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.

  Changed 21 months ago by martinkou

  • keywords Review+ removed
  • status changed from closed to reopened
  • resolution fixed deleted

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.

  Changed 21 months ago by fredck

  • status changed from reopened to closed
  • resolution set to fixed

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

in reply to: ↑ 9 ; follow-up: ↓ 13   Changed 19 months ago by mxm

  • status changed from closed to reopened
  • resolution fixed deleted
  • component changed from File Browser to Server : ASP.Net
  • milestone changed from FCKeditor 2.6.1 to FCKeditor 2.6.4

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;}}})();" );

in reply to: ↑ 12   Changed 18 months ago by fredck

  • status changed from reopened to closed
  • resolution set to fixed

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.

  Changed 18 months 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.