Ticket #1055: 1055.patch

File 1055.patch, 2.3 KB (added by Martin Kou, 16 years ago)
  • _whatsnew.html

     
    5858                        mode.</li>
    5959                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
    6060                        JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
     61                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added logic
     62                        to override JavaScript errors occuring inside the editing frame due to user added
     63                        JavaScript code.</li>
    6164        </ul>
    6265        <h3>
    6366                Version 2.6 Beta 1</h3>
  • editor/_source/classes/fckeditingarea.js

     
    9292                // Create the editing area IFRAME.
    9393                var oIFrame = this.IFrame = oTargetDocument.createElement( 'iframe' ) ;
    9494
     95                // IE: Avoid JavaScript errors thrown by the editing are source (like tags events).
     96                // See #1055.
     97                var sOverrideError = '<script>window.onerror=function(){return true;};//FCK_IGNORE</script>' ;
     98
    9599                oIFrame.frameBorder = 0 ;
    96100                oIFrame.width = oIFrame.height = '100%' ;
    97101
    98102                if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
    99103                {
    100                         window._FCKHtmlToLoad = html ;
     104                        window._FCKHtmlToLoad = sOverrideError + html ;
    101105                        oIFrame.src = 'javascript:void( (function(){' +
    102106                                'document.open() ;' +
    103107                                'document.domain="' + document.domain + '" ;' +
     
    129133                        var oDoc = this.Window.document ;
    130134
    131135                        oDoc.open() ;
     136                        oDoc.write( sOverrideError ) ;
    132137                        oDoc.write( html ) ;
    133138                        oDoc.close() ;
    134139                }
  • editor/_source/internals/fck.js

     
    248248                        FCKConfig.IgnoreEmptyParagraphValue,
    249249                        format ) ;
    250250
     251                // Remove <SCRIPT> tags with FCK_IGNORE (For #1055 in full page mode).
     252                if ( isFullPage )
     253                        data = data.replace( /\s*<script[^<>]*>[^<>]*\/\/FCK_IGNORE[^<>]*<\/script>/ig, '' ) ;
     254
    251255                // Restore protected attributes.
    252256                data = FCK.ProtectEventsRestore( data ) ;
    253257
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy