Skip to content

Commit

Permalink
Be precise when (un)protecting source in attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Mar 13, 2014
1 parent 4d9b6bb commit 6675efb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/htmldataprocessor.js
Expand Up @@ -883,8 +883,9 @@

// Different protection pattern is used for those that
// live in attributes to avoid from being HTML encoded.
return data.replace( /(['"]).*?\1/g, function( match ) {
return match.replace( /<!--\{cke_protected\}([\s\S]+?)-->/g, function( match, data ) {
// Why so serious? See #9205, #8216, #7805.
return data.replace( /<\w([^'">]+|'[^']*'|"[^"]*")+>/g, function( match ) {
return match.replace( /<!--\{cke_protected\}([^>]*)-->/g, function( match, data ) {
store[ store.id ] = decodeURIComponent( data );
return '{cke_protected_' + ( store.id++ ) + '}';
} );
Expand Down

0 comments on commit 6675efb

Please sign in to comment.