Permalink
Browse files

Merge branch 't/11811b'

  • Loading branch information...
pjasiun committed May 12, 2014
2 parents 11e6c22 + 75a81ec commit edf271da7c61d5c7ce6cf3f9443efa0916daed86
Showing with 4 additions and 3 deletions.
  1. +1 −0 CHANGES.md
  2. +3 −3 plugins/widget/plugin.js
View
@@ -29,6 +29,7 @@ Fixed Issues:
* [#11798](http://dev.ckeditor.com/ticket/11798): Fixed: Inserting non-editable element inside a table cell breaks the table badly.
* [#11793](http://dev.ckeditor.com/ticket/11793): Fixed: Drop down is not "on" when clicking it while editor is blurred.
* [#11850](http://dev.ckeditor.com/ticket/11850): Fixed: Filter downcasting fake object to element it replaced is not applied if fake object element is non-editable.
+* [#11811](http://dev.ckeditor.com/ticket/11811): Fixed: Widget's data are not encoded correctly when passed to attribute.
Other changes:
View
@@ -1868,7 +1868,7 @@
element = upcasted;
// Set initial data attr with data from upcast method.
- element.attributes[ 'data-cke-widget-data' ] = JSON.stringify( data );
+ element.attributes[ 'data-cke-widget-data' ] = encodeURIComponent( JSON.stringify( data ) );
element.attributes[ 'data-cke-widget-upcasted' ] = 1;
toBeWrapped.push( [ element, upcast[ 1 ] ] );
@@ -3091,7 +3091,7 @@
var widgetDataAttr = widget.element.data( 'cke-widget-data' );
if ( widgetDataAttr )
- widget.setData( JSON.parse( widgetDataAttr ) );
+ widget.setData( JSON.parse( decodeURIComponent( widgetDataAttr ) ) );
if ( startupData )
widget.setData( startupData );
@@ -3116,7 +3116,7 @@
}
function writeDataToElement( widget ) {
- widget.element.data( 'cke-widget-data', JSON.stringify( widget.data ) );
+ widget.element.data( 'cke-widget-data', encodeURIComponent( JSON.stringify( widget.data ) ) );
}
//

0 comments on commit edf271d

Please sign in to comment.