Opened 4 years ago

Closed 4 years ago

#8634 closed Bug (fixed)

The editor.execCommand('cut') returns true instead of false, on IE

Reported by: helsom Owned by: j.swiderski
Priority: Normal Milestone: CKEditor 3.6.3
Component: Core : Pasting Version: 3.4.2
Keywords: Cc:

Description

Whilst trying to make use of the existing 'cut' command, within the clipboard plugin, I encountered a problem where editor.execCommand('cut') was always returning true on IE, even though browser settings prevented automatic execution of cut/copy operations.

Delving a bit deeper, it looks like execIECommand() in the plugins/clipboard/plugin.js returns 0 or 1 which is eventually compared to false (using the !== operator) in core/command.js, line 52. Modifying execIECommand() to set enabled to false or true (instead of 0 or 1) seems to resolve the problem.

Attachments (1)

8634.patch (507 bytes) - added by j.swiderski 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by j.swiderski

  • Status changed from new to confirmed
  • Version changed from 3.6.2 to 3.4.2

REproducible from CKEditor 3.4.2 rev [5949]

Changing false/true

var	enabled = false;
var onExec = function()
{
	enabled = true;
};

to 0/1

var	enabled = 0;
var onExec = function()
{
	enabled = 1;
};

resulted in constant true being returned when comparing it to:

return ( commandDefinition.exec.call( this, editor, data ) !== false );

comment:2 Changed 4 years ago by j.swiderski

  • Owner set to j.swiderski
  • Status changed from confirmed to assigned

Changed 4 years ago by j.swiderski

comment:3 Changed 4 years ago by j.swiderski

  • Status changed from assigned to review

comment:4 Changed 4 years ago by fredck

  • Component changed from General to Core : Pasting
  • Milestone set to CKEditor 3.6.3
  • Status changed from review to review_passed

Very tricky finding... well done ;)

comment:5 Changed 4 years ago by j.swiderski

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7385]

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy