Ticket #5162: 5162_2.patch

File 5162_2.patch, 1.3 KB (added by Frederico Caldeira Knabben, 14 years ago)
  • _source/plugins/undo/plugin.js

     
    120120        // Gets a snapshot image which represent the current document status.
    121121        function Image( editor )
    122122        {
    123                 var selection = editor.getSelection();
     123                var selection = editor.getSelection(),
     124                        contents = this.contents = editor.getSnapshot();
    124125
    125                 this.contents   = editor.getSnapshot();
    126126                this.bookmarks  = selection && selection.createBookmarks2( true );
    127127
    128128                // In IE, we need to remove the expando attributes.
    129                 if ( CKEDITOR.env.ie )
    130                         this.contents = this.contents.replace( /\s+_cke_expando=".*?"/g, '' );
     129                if ( CKEDITOR.env.ie && contents )
     130                        this.contents = contents.replace( /\s+_cke_expando=".*?"/g, '' );
    131131        }
    132132
    133133        // Attributes that browser may changing them when setting via innerHTML.
     
    351351                        if ( !image )
    352352                                image = new Image( this.editor );
    353353
     354                        // Do nothing if it was not possible to retrieve an image.
     355                        if ( image.contents === false )
     356                                return;
     357
    354358                        // Check if this is a duplicate. In such case, do nothing.
    355359                        if ( this.currentImage && image.equals( this.currentImage, onContentOnly ) )
    356360                                return false;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy