Opened 13 years ago

Closed 12 years ago

#8022 closed Bug (wontfix)

Paste of relative path image with baseHref set results in wrong urls in IE

Reported by: Freddie Bingham Owned by:
Priority: Normal Milestone:
Component: General Version: 3.1
Keywords: CantFix Cc:

Description (last modified by Jakub Ś)

This doesn't ever seem to work in FF, but it does in IE with baseHref is not defined.

  1. Set config.baseHref
  2. Visit a website that images set via relative urls, e.g. <img src="../somethingimage.png" />
  3. Right-click an image, select "Copy".
  4. Go to editor and paste image.
  5. Observe that image is broken and inspection of the image shows that the img src now includes the baseHref that was set with config.baseHref.

Make the same action with baseHref not set and the image displays as it contains the full url to the image from which it was copied. Even though the source image contained a relative path, the paste action results in the full URL being used unless baseHref is set.


According comment_5 this is a won't fix and can't fix

Attachments (1)

template_test.html (478 bytes) - added by Jakub Ś 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by Jakub Ś

Status: newconfirmed
Version: 3.1

According to http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.baseHref this attribute means: "The base href URL used to resolve relative and absolute URLs in the editor content."

The browser behavior is inconsistent with this description.

  1. IE - If you copy image with absolute path than this path is used. If you copy image with relative path than this path is joined with baseHref value. It has been working like this for IE from CKEditor 3.1
  1. FF4 - uses data: for pasted image.
  2. FF3.6 - uses file: for pasted image.
  3. Chrome - ignores this attribute and always pastes whole URL
  4. Opera and Safari- you can't paste an image like this.

Point one describes this particular ticket but the whole issue is in my opinion related to #8021

Version 0, edited 13 years ago by Jakub Ś (next)

comment:2 Changed 13 years ago by Freddie Bingham

"The base href URL used to resolve relative and absolute URLs in the editor content."

You seem to imply that the correct behavior here would be for all browsers to behave as IE is behaving.

The baseHref setting should not apply in this context. When there is no baseHref, the full foreign url is used but when there is a baseHref set, that url is thrown away and we use baseHref, breaking the image? The code is doing this per design?

comment:3 Changed 13 years ago by Jakub Ś

Could you tell me how in your opinion this option should work?

Last edited 12 years ago by Jakub Ś (previous) (diff)

comment:4 Changed 13 years ago by Freddie Bingham

If nothing is known about a relative URL, then yes, of course, base href should be used, if set. If the full URL is known, which IE seems to know in this case, then the full URL should be used. There is no benefit to replacing it with the base href in this context. I asked if this decision was being made by CKEditor or if it was being done by IE.

Changed 12 years ago by Jakub Ś

Attachment: template_test.html added

comment:5 Changed 12 years ago by Jakub Ś

  1. Open template test in IE browser.
  2. Go to http://refcardz.dzone.com/refcardz/getting-started-java-gui and copy author image with CRTL+C
  3. Paste it into editable section with CRTL+V - Image got pasted
  4. Uncomment base tag in template and reload the page
  5. Try to copy/paste image once more - Image is not pasted because URL is broken

Looks like IE is breaking the URL.

comment:6 Changed 12 years ago by Jakub Ś

Description: modified (diff)

comment:7 Changed 12 years ago by Jakub Ś

Keywords: CantFix added
Resolution: wontfix
Status: confirmedclosed

Taking comment_5 into account I;m closing this ticket as it can't be fixed.

Editor receives post processed data and there is no way to figure out correct URL.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy