Skip to content
Permalink
Browse files

Merge branch 't/13385'

  • Loading branch information...
Reinmar committed Jul 8, 2015
2 parents 9966124 + 846ae53 commit fafab77513599b4d5deebf05a8a06cf386434042
Showing with 26 additions and 3 deletions.
  1. +1 −0 CHANGES.md
  2. +13 −2 core/editor.js
  3. +12 −1 tests/core/editor/destroy.js
@@ -12,6 +12,7 @@ Fixed Issues:
* [#13419](http://dev.ckeditor.com/ticket/13419): Fixed: [Auto Link](http://ckeditor.com/addon/autolink) plugin does not encode double quotes in URLs.
* [#13460](http://dev.ckeditor.com/ticket/13460): [IE8] Fixed: Copying inline widgets is broken when the Advanced Content Filter is disabled.
* [#13495](http://dev.ckeditor.com/ticket/13495): [Firefox,IE] Fixed: Text is not word-wrapped in the Paste dialog.
* [#13385](http://dev.ckeditor.com/ticket/13385): Fixed: [`editor.getSnapshot()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getSnapshot) may return a non-string value.

## CKEditor 4.5.1

@@ -904,15 +904,26 @@
*
* alert( editor.getSnapshot() );
*
* @see CKEDITOR.editor#getData
* See also:
*
* * {@link CKEDITOR.editor#getData}.
*
* @returns {String} Editor "raw data".
*/
getSnapshot: function() {
var data = this.fire( 'getSnapshot' );

if ( typeof data != 'string' ) {
var element = this.element;
if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )

if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) {
data = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
}
else {
// If we don't have a proper element, set data to an empty string,
// as this method is expected to return a string. (#13385)
data = '';
}
}

return data;
@@ -25,5 +25,16 @@ bender.test(
} );

} );
},

// #13385.
'test getSnapshot returns empty string after editor destroyed': function() {
bender.editorBot.create( {}, function( bot ) {
this.wait( function() {
var editor = bot.editor;
editor.destroy();
assert.areSame( '', editor.getSnapshot() );
}, 0 );
} );
}
} );
} );

0 comments on commit fafab77

Please sign in to comment.
You can’t perform that action at this time.