public/javascripts/fckeditor/editor/filemanager/connectors/test.html in typo-5.0.3.98.1 vs public/javascripts/fckeditor/editor/filemanager/connectors/test.html in typo-5.1

- old
+ new

@@ -1,8 +1,8 @@ <!-- * FCKeditor - The text editor for Internet - http://www.fckeditor.net - * Copyright (C) 2003-2007 Frederico Caldeira Knabben + * Copyright (C) 2003-2008 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: @@ -22,10 +22,43 @@ --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>FCKeditor - Connectors Tests</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> + +// Automatically detect the correct document.domain (#1919). +(function() +{ + var d = document.domain ; + + while ( true ) + { + // Test if we can access a parent property. + try + { + var test = window.opener.document.domain ; + break ; + } + catch( e ) {} + + // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... + d = d.replace( /.*?(?:\.|$)/, '' ) ; + + if ( d.length == 0 ) + break ; // It was not able to detect the domain. + + try + { + document.domain = d ; + } + catch (e) + { + break ; + } + } +})() ; function BuildBaseUrl( command ) { var sUrl = document.getElementById('cmbConnector').value +