Inconsistent use of decodeURI in image dialog
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:
- Open the image dialog for an image on a page with UTF-8 as charset
- Paste the following ISO-8859-1 URI as the link address: http://google.com/?q=%C5rsrapport
- Click "OK"
- Result: JavaScript URIError
Browser: Safari 6.0.5 OS: Mac OS X 10.8.4
Change History (10)
Status: |
new →
confirmed
|
Version: |
4.1.1 →
3.0
|
Owner: |
set to Jakub Ś
|
Status: |
confirmed →
assigned
|
Owner: |
changed from Jakub Ś to Artur Delura
|
Status: |
assigned →
review
|
Status: |
review →
review_passed
|
Milestone: |
→ CKEditor 4.4.2
|
Resolution: |
→ fixed
|
Status: |
review_passed →
closed
|
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