Ticket #3869: 3869.patch
File 3869.patch, 3.1 KB (added by , 16 years ago) |
---|
-
plugins/htmldataprocessor/plugin.js
249 249 { 250 250 data = data.replace( regexes[i], function( match ) 251 251 { 252 match = match.replace( /<\!--{(.*?)}(.*?)-->/g, // Restore the inner text (#3869). 253 function( a, marker, comment ) 254 { 255 return ( "{" + marker + "}" == protectedSourceMarker ) ? 256 decodeURIComponent( comment ) 257 : 258 comment; 259 } 260 ); 252 261 return '<!--' + protectedSourceMarker + encodeURIComponent( match ).replace( /--/g, '%2D%2D' ) + '-->'; 253 262 }); 254 263 } -
tests/plugins/htmldataprocessor/htmldataprocessor.html
270 270 dataProcessor.toDataFormat( protectedHtml ) ); 271 271 }, 272 272 273 test_ticket_3869_1 : function() 274 { 275 var editor = CKEDITOR.instances.editor1, 276 dataProcessor = editor.dataProcessor; 273 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 dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter(); 295 var html = getTextAreaValue( '_TEXTAREA_3869_2' ); 296 var protectedHtml = dataProcessor.toHtml( html ); 297 298 assert.areSame( html , dataProcessor.toDataFormat( protectedHtml ) ); 299 }, 300 274 301 name : document.title 275 302 }; 276 303 })() ); … … 290 317 <textarea id="_TEXTAREA_3591"><object><param /><param /><embed></embed></object></textarea> 291 318 <textarea id="_TEXTAREA_3591_protected"><cke:object><cke:param></cke:param><cke:param></cke:param><cke:embed></cke:embed></cke:object></textarea> 292 319 <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> 320 <textarea id="_TEXTAREA_3869_1">#3869<script language="Javascript" type="text/javascript"> 321 <!-- 322 alert('-->') 323 //--> 324 </script></textarea> 325 <textarea id="_TEXTAREA_3869_2">#3869<? 326 echo '<script type="text/javascript">'; 327 echo '<!--alert("-->");//-->'; 328 echo '</script>'; 329 ?><!--<%Response.Write(now())%>//--><!-- <script language="Javascript" type="text/javascript"></script> --></textarea> 293 330 </body> 294 331 </html>