Ticket #3869: 3869_2.patch

File 3869_2.patch, 4.2 KB (added by Artur Formella, 15 years ago)
  • _source/plugins/htmldataprocessor/plugin.js

     
    248248                {
    249249                        data = data.replace( regexes[i], function( match )
    250250                                {
     251                                        match = match.replace( /<\!--{(.*?)}(.*?)-->/g,         // There could be protected source inside another one. (#3869).
     252                                                function( a, marker, comment )
     253                                                {
     254                                                        return ( "{" + marker + "}" == protectedSourceMarker ) ?
     255                                                                        decodeURIComponent( comment )
     256                                                                :
     257                                                                        comment;
     258                                                }
     259                                        );
    251260                                        return '<!--' + protectedSourceMarker + encodeURIComponent( match ).replace( /--/g, '%2D%2D' ) + '-->';
    252261                                });
    253262                }
  • _source/tests/plugins/htmldataprocessor/htmldataprocessor.html

     
    270270                                dataProcessor.toDataFormat( protectedHtml ) );
    271271                },
    272272
     273                test_ticket_3869_1 : function()
     274                {
     275                        var editor = CKEDITOR.instances.editor1,
     276                                dataProcessor = editor.dataProcessor;
     277 
     278                        dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter();
     279                        var html = getTextAreaValue( '_TEXTAREA_3869_1' );
     280                        var protectedHtml = dataProcessor.toHtml( html );
     281
     282                        assert.areSame( html , dataProcessor.toDataFormat( protectedHtml ) );
     283                },
     284
     285                test_ticket_3869_2 : function()
     286                {
     287                        var editor = CKEDITOR.instances.editor1,
     288                                dataProcessor = editor.dataProcessor,
     289                                config = editor.config;
     290
     291                        config.protectedSource.push( /<\?[\s\S]*?\?>/g );   // PHP Code
     292                        config.protectedSource.push( /<%[\s\S]*?%>/g );   // ASP Code
     293                        config.protectedSource.push( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi );   // ASP.Net Code
     294                        config.protectedSource.push(/<gallery[\s\S]*?<\/gallery>/gi );  // custom protected source
     295                        config.protectedSource.push(/<options[\s\S]*?<\/options>/gi );
     296                        dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter();
     297                        var html = getTextAreaValue( '_TEXTAREA_3869_2' );
     298                        var protectedHtml = dataProcessor.toHtml( html );
     299
     300                        assert.areSame( html , dataProcessor.toDataFormat( protectedHtml ) );
     301                },
     302
    273303                /**
    274304                 * Test empty value attributes.
    275305                 */
     
    301331include ("head.html"); ?></td></tr></tbody></table><noscript>Your browser doesn't support JavaScript</noscript></textarea>
    302332        <textarea id="_TEXTAREA_3591"><object><param /><param /><embed></embed></object></textarea>
    303333        <textarea id="_TEXTAREA_3591_protected"><cke:object><cke:param></cke:param><cke:param></cke:param><cke:embed></cke:embed></cke:object></textarea>
     334        <textarea id="_TEXTAREA_3869_1">#3869<script language="Javascript" type="text/javascript">
     335        <!--
     336                alert('-->')
     337        //-->
     338        </script></textarea>
     339        <textarea id="_TEXTAREA_3869_2">#3869<gallery>
     340        file.jpg
     341        <options name="test1" value="value1"></options>
     342        <options name="test2" value="value2"></options>
     343        </gallery><?
     344                echo '<script type="text/javascript">';
     345                echo '<!--alert("-->");//-->';
     346                echo '</script>';
     347        ?><!--<%Response.Write(now())%>//--><!-- <script language="Javascript" type="text/javascript"></script> --></textarea>
    304348        <textarea id="_TEXTAREA_3591_2"><object classid="clsid"><param name="movie" value="movie.swf" /><embed src="movie.swf" type="application/x-shockwave-flash"></embed></object></textarea>
    305349</body>
    306350</html>
  • CHANGES.html

     
    4444        <p>
    4545                Fixed issues:</p>
    4646        <ul>
     47                <li><a href="http://dev.fckeditor.net/ticket/3869">#3869</a> : Now it is possible to insert protected source inside another one</li>
    4748                <li><a href="http://dev.fckeditor.net/ticket/3859">#3859</a> : Fixed Flash dialog layout in Webkit</li>
    4849                <li><a href="http://dev.fckeditor.net/ticket/3852">#3852</a> : Disabled textarea resizing in dialogs</li>
    4950                <li><a href="http://dev.fckeditor.net/ticket/3781">#3781</a> : Colorbutton is now disabled in 'source' mode</li>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy