Opened 7 years ago

Last modified 7 years ago

#9211 confirmed Bug

Editor content replaced with a link's destination page when the editor is in readonly mode

Reported by: nuffsaid Owned by:
Priority: Normal Milestone:
Component: Core : Read-only Version: 3.6
Keywords: Cc:

Description

Steps:

Make it so you have an image with a link in the editor. Something like this:

<a href="http://www.google.com"><img alt="smiley" height="20" src="http://nightly-v4.ckeditor.com/3419/plugins/smiley/images/regular_smile.gif" title="smiley" width="20" /></a>

-Make the editor read-only

-Click on the image

Result: The link's url is followed and the ckeditor's content area is replaced with the destination page. This brakes the ckeditor's functionalities even if the buttons are still visible.

If the link has only text, the link is not followed and no problem arise.

Reproducible on every browser at http://ckeditor.com/demo with

CKEDITOR.instances.editor1.setReadOnly( true )

after adding the link to the image.

Or, since there is a button to make read-only, even more easily at: http://nightly-v4.ckeditor.com/3419/samples/readonly.html

Change History (1)

comment:1 Changed 7 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.43.6

Problem has been reproducible from CKEditor 3.6.

All browsers complain about forbidden access but only Webkit does not redirect to other page thus making editor still work. In rest of browsers editor breaks.

We could:

  1. Block Link execution by adding onclick="return false;" to all links when readOnly mode is activated
  2. Another option is opening links in new window by adding target="_blank" when readOnly mode is activated

Of course links could already have target or onclick set so CKEditor should keep track of these attributes. Write their state (in form of some custom attribute) and bring it back once the readOnly mode is turned off.

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