Skip to content

Commit

Permalink
Merge branch 't/10298'
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed May 29, 2013
2 parents e17fb2e + c451e34 commit 8ad21b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -10,6 +10,7 @@ CKEditor 4 Changelog
* [#10367](http://dev.ckeditor.com/ticket/10367): Fixed: editable#insertText loses characters if RegExp replace controls are inserted.
* [#10146](http://dev.ckeditor.com/ticket/10146): [Firefox] Empty lines are being removed while config#enterMode is ENTER_BR.
* [#6504](http://dev.ckeditor.com/ticket/6504): Resolved race condition while loading several customConfig files.
* [#10298](http://dev.ckeditor.com/ticket/10298): Data processor breaks attributes containing protected parts.

## CKEditor 4.1.1

Expand Down
6 changes: 4 additions & 2 deletions core/htmldataprocessor.js
Expand Up @@ -658,7 +658,7 @@
}

var protectElementRegex = /<(a|area|img|input|source)\b([^>]*)>/gi,
protectAttributeRegex = /\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi;
protectAttributeRegex = /\s(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi;

// Note: we use lazy star '*?' to prevent eating everything up to the last occurrence of </style> or </textarea>.
var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
Expand All @@ -675,8 +675,10 @@
return '<' + tag + attributes.replace( protectAttributeRegex, function( fullAttr, attrName ) {
// Avoid corrupting the inline event attributes (#7243).
// We should not rewrite the existed protected attributes, e.g. clipboard content from editor. (#5218)
if ( !( /^on/ ).test( attrName ) && attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )
if ( !( /^on/ ).test( attrName ) && attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 ) {
fullAttr = fullAttr.slice( 1 ); // Strip the space.
return ' data-cke-saved-' + fullAttr + ' data-cke-' + CKEDITOR.rnd + '-' + fullAttr;
}

return fullAttr;
}) + '>';
Expand Down

0 comments on commit 8ad21b6

Please sign in to comment.