Ticket #7243: 7243.patch

File 7243.patch, 2.2 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/plugins/htmldataprocessor/plugin.js

     
    4444                        typeof extendEmptyBlock == 'function' && ( extendEmptyBlock( block ) === false ) ) )
    4545                        return false;
    4646
    47         // 1. For IE version >=8,  empty blocks are displayed correctly themself in wysiwiyg;
    48         // 2. For the rest, at least table cell and list item need no filler space.
    49         // (#6248)
    50         if ( fromSource && CKEDITOR.env.ie &&
    51                 ( document.documentMode > 7
    52                 || block.name in CKEDITOR.dtd.tr
    53                 || block.name in CKEDITOR.dtd.$listItem ) )
    54             return false;
     47        // 1. For IE version >=8,  empty blocks are displayed correctly themself in wysiwiyg;
     48        // 2. For the rest, at least table cell and list item need no filler space.
     49        // (#6248)
     50        if ( fromSource && CKEDITOR.env.ie &&
     51                ( document.documentMode > 7
     52                        || block.name in CKEDITOR.dtd.tr
     53                        || block.name in CKEDITOR.dtd.$listItem ) )
     54                return false;
    5555
    5656                var lastChild = lastNoneSpaceChild( block );
    5757
     
    289289        }
    290290
    291291        var protectElementRegex = /<(a|area|img|input)\b([^>]*)>/gi,
    292                 protectAttributeRegex = /\b(href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi;
     292                protectAttributeRegex = /\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi;
    293293
    294294        var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
    295295                encodedElementsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi;
     
    305305                {
    306306                        return '<' +  tag + attributes.replace( protectAttributeRegex, function( fullAttr, attrName )
    307307                        {
     308                                // Avoid corrupting the inline event attributes (#7243).
    308309                                // We should not rewrite the existed protected attributes, e.g. clipboard content from editor. (#5218)
    309                                 if ( attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )
     310                                if ( !/^on/.test( attrName ) && attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )
    310311                                        return ' data-cke-saved-' + fullAttr + ' ' + fullAttr;
    311312
    312313                                return fullAttr;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy