Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#10867 closed Bug (fixed)

Inconsistent use of decodeURI in image dialog

Reported by: Frode Danielsen Owned by: Artur Delura
Priority: Normal Milestone: CKEditor 4.4.2
Component: General Version: 3.0
Keywords: IBM Cc: irinauru@…


A previous ticket (#5256) concerned the use of decodeURI for the image "src" attribute in the image dialog. The ticket was resolved by removing the use of decodeURI here, to be consistent with how it is not used in the link dialog.

decodeURI is still used for the "href" attribute of the link for an image though. This can cause similar problems as in #5256. It also causes problems when trying to use a link that has been encoded in a different character set than the page of CKEditor (ie. ISO-8859-1 versus UTF-8). The character encoding of a link is related to the site the link refers to, and not necessarily the site it is linked from, and thus CKEditor can't make assumptions about it.

Steps to reproduce:

  1. Open the image dialog for an image on a page with UTF-8 as charset
  2. Paste the following ISO-8859-1 URI as the link address:
  3. Click "OK"
  4. Result: JavaScript URIError

Browser: Safari 6.0.5 OS: Mac OS X 10.8.4

Change History (10)

comment:1 Changed 5 years ago by Jakub Ś

Status: newconfirmed

Problem can be reproduced in all browsers from CKEditor 3.0 in both CKE 4.x and 3.x branches.

JS error is: Message: URIError: malformed URI sequence
Code: var url = decodeURI( this.getValue() );
Line: 966
URI: /ckeditor4/plugins/image/dialogs/image.js

comment:2 Changed 5 years ago by Jakub Ś

#11018 was marked as duplicate.

comment:3 Changed 5 years ago by Jakub Ś

Owner: set to Jakub Ś
Status: confirmedassigned

comment:4 Changed 5 years ago by Irina

Cc: irinauru@… added

comment:5 Changed 4 years ago by Artur Delura

Owner: changed from Jakub Ś to Artur Delura

comment:6 Changed 4 years ago by Irina

Keywords: IBM added

comment:7 Changed 4 years ago by Artur Delura

Status: assignedreview

Changes and tests in branch:t/10867

comment:8 Changed 4 years ago by Piotrek Koszuliński

Status: reviewreview_passed

I rebased branch and pushed commit simplifying tests.

comment:9 Changed 4 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.2

comment:10 Changed 4 years ago by Artur Delura

Resolution: fixed
Status: review_passedclosed

Merged to master with git:91779e8.

Last edited 4 years ago by Artur Delura (previous) (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy