Skip to content

Commit edf271d

Browse files
author
Piotr Jasiun
committed
Merge branch 't/11811b'
2 parents 11e6c22 + 75a81ec commit edf271d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Fixed Issues:
2929
* [#11798](http://dev.ckeditor.com/ticket/11798): Fixed: Inserting non-editable element inside a table cell breaks the table badly.
3030
* [#11793](http://dev.ckeditor.com/ticket/11793): Fixed: Drop down is not "on" when clicking it while editor is blurred.
3131
* [#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.
32+
* [#11811](http://dev.ckeditor.com/ticket/11811): Fixed: Widget's data are not encoded correctly when passed to attribute.
3233

3334
Other changes:
3435

plugins/widget/plugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@
18681868
element = upcasted;
18691869

18701870
// Set initial data attr with data from upcast method.
1871-
element.attributes[ 'data-cke-widget-data' ] = JSON.stringify( data );
1871+
element.attributes[ 'data-cke-widget-data' ] = encodeURIComponent( JSON.stringify( data ) );
18721872
element.attributes[ 'data-cke-widget-upcasted' ] = 1;
18731873

18741874
toBeWrapped.push( [ element, upcast[ 1 ] ] );
@@ -3091,7 +3091,7 @@
30913091
var widgetDataAttr = widget.element.data( 'cke-widget-data' );
30923092

30933093
if ( widgetDataAttr )
3094-
widget.setData( JSON.parse( widgetDataAttr ) );
3094+
widget.setData( JSON.parse( decodeURIComponent( widgetDataAttr ) ) );
30953095
if ( startupData )
30963096
widget.setData( startupData );
30973097

@@ -3116,7 +3116,7 @@
31163116
}
31173117

31183118
function writeDataToElement( widget ) {
3119-
widget.element.data( 'cke-widget-data', JSON.stringify( widget.data ) );
3119+
widget.element.data( 'cke-widget-data', encodeURIComponent( JSON.stringify( widget.data ) ) );
31203120
}
31213121

31223122
//

0 commit comments

Comments
 (0)