Ticket #1426: 1426.patch

File 1426.patch, 2.5 kB (added by martinkou, 5 months ago)
  • _whatsnew.html

     
    4242        <p> 
    4343                Fixed Bugs:</p> 
    4444        <ul> 
    45                 <li></li> 
     45                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1426">#1426</a>] Fixed the error loading 
     46                        fckstyles.xml in servers which cannot return the correct content type header for .xml files.</li> 
    4647        </ul> 
    4748        <h3> 
    4849                Version 2.6</h3> 
  • editor/_source/classes/fckxml_gecko.js

     
    3232                oXmlHttp.open( 'GET', urlToCall, false ) ; 
    3333                oXmlHttp.send( null ) ; 
    3434 
    35                 if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) 
     35                if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) ) 
     36                { 
    3637                        oXml = oXmlHttp.responseXML ; 
    37                 else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) 
    38                         oXml = oXmlHttp.responseXML ; 
     38                        // #1426: Fallback if responseXML isn't set for some 
     39                        // reason (e.g. improperly configured web server) 
     40                        if ( !oXml ) 
     41                                oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ; 
     42                } 
    3943                else 
    4044                        oXml = null ; 
    4145 
  • editor/_source/classes/fckxml_ie.js

     
    4040 
    4141                oXmlHttp.send( null ) ; 
    4242 
    43                 if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) 
     43                if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) ) 
     44                { 
    4445                        this.DOMDocument = oXmlHttp.responseXML ; 
    45                 else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) 
    46                 { 
    47                         this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ; 
    48                         this.DOMDocument.async = false ; 
    49                         this.DOMDocument.resolveExternals = false ; 
    50                         this.DOMDocument.loadXML( oXmlHttp.responseText ) ; 
     46 
     47                        // #1426: Fallback if responseXML isn't set for some 
     48                        // reason (e.g. improperly configured web server) 
     49                        if ( !this.DOMDocument ) 
     50                        { 
     51                                this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ; 
     52                                this.DOMDocument.async = false ; 
     53                                this.DOMDocument.resolveExternals = false ; 
     54                                this.DOMDocument.loadXML( oXmlHttp.responseText ) ; 
     55                        } 
    5156                } 
    5257                else 
    5358                {