Ticket #6002: 6002.patch

File 6002.patch, 1.8 KB (added by Alessandro, 14 years ago)

Proposed patch: moving regexps to configuration

  • _source/plugins/htmldataprocessor/plugin.js

     
    333333                var protectedHtml = [],
    334334                        tempRegex = /<\!--\{cke_temp(comment)?\}(\d*?)-->/g;
    335335
    336                 var regexes =
    337                         [
    338                                 // Script tags will also be forced to be protected, otherwise
    339                                 // IE will execute them.
    340                                 ( /<script[\s\S]*?<\/script>/gi ),
     336                var regexes = protectRegexes;
    341337
    342                                 // <noscript> tags (get lost in IE and messed up in FF).
    343                                 /<noscript[\s\S]*?<\/noscript>/gi
    344                         ]
    345                         .concat( protectRegexes );
    346 
    347338                // First of any other protection, we must protect all comments
    348339                // to avoid loosing them (of course, IE related).
    349340                // Note that we use a different tag for comments, as we need to
     
    409400                {
    410401                        // The source data is already HTML, but we need to clean
    411402                        // it up and apply the filter.
     403                        data = protectSource( data, this.editor.config.defaultProtectedSource.concat( this.editor.config.protectedSource ) );
    412404
    413                         data = protectSource( data, this.editor.config.protectedSource );
    414 
    415405                        // Before anything, we must protect the URL attributes as the
    416406                        // browser may changing them when setting the innerHTML later in
    417407                        // the code.
     
    484474 * config.forceSimpleAmpersand = false;
    485475 */
    486476CKEDITOR.config.forceSimpleAmpersand = false;
     477
     478/**
     479 * Protection regexes for script tags.
     480 */
     481CKEDITOR.config.defaultProtectedSource = [
     482        // Script tags will also be forced to be protected, otherwise
     483        // IE will execute them.
     484        ( /<script[\s\S]*?<\/script>/gi ),
     485
     486        // <noscript> tags (get lost in IE and messed up in FF).
     487        /<noscript[\s\S]*?<\/noscript>/gi
     488];
     489 No newline at end of file
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy