Show
Ignore:
Timestamp:
2008-06-12 11:52:09 (7 months ago)
Author:
fredck
Message:

Fixed #2115 : Fixed JavaScript (permission denied) error in Firefox when file has been uploaded.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/filemanager/connectors/cfm/cf5_upload.cfm

    r1797 r2059  
    4848        { 
    4949                WriteOutput('<script type="text/javascript">'); 
    50                 WriteOutput("(function()"& 
    51 "{"& 
    52 "       var d = document.domain ;"& 
    53 ""& 
    54 "       while ( true )"& 
    55 "       {"& 
    56                 // Test if we can access a parent property. 
    57 "               try"& 
    58 "               {"& 
    59 "                       var test = window.top.opener.document.domain ;"& 
    60 "                       break ;"& 
    61 "               }"& 
    62 "               catch( e ) {}"& 
    63 ""& 
    64                 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 
    65 "               d = d.replace( /.*?(?:\.|$)/, '' ) ;"& 
    66 ""& 
    67 "               if ( d.length == 0 )"& 
    68                         // It was not able to detect the domain. 
    69 "                       break ;"& 
    70 ""& 
    71 "               try"& 
    72 "               {"& 
    73 "                       document.domain = d ;"& 
    74 "               }"& 
    75 "               catch (e)"& 
    76 "               {"& 
    77 "                       break ;"& 
    78 "               }"& 
    79 "       }"& 
    80 "})() ;"); 
    81  
     50                // Minified version of the document.domain automatic fix script (#1919).  
     51                // The original script can be found at _dev/domain_fix_template.js 
     52                WriteOutput("(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;}}})();"); 
    8253                WriteOutput('window.parent.OnUploadCompleted(' & errorNumber & ', "' & JSStringFormat(fileUrl) & '", "' & JSStringFormat(fileName) & '", "' & JSStringFormat(customMsg) & '");' ); 
    8354                WriteOutput('</script>');