Opened 12 years ago
Last modified 12 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
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:
onclick="return false;"
to all links when readOnly mode is activatedtarget="_blank"
when readOnly mode is activatedOf 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.