Opened 7 years ago

Closed 5 years ago

#5527 closed Bug (fixed)

Anchor (#) in URL gets urlencoded when using

Reported by: jschroeter Owned by: alfonsoml
Priority: Normal Milestone: CKEditor 3.6.3
Component: General Version: SVN (CKEditor) - OLD
Keywords: Confirmed Cc:


When calling, "");

out of our custom filebrowser, CKEditor will convert the URL to

I guess this isn't a feature?

Attachments (2) (1.7 KB) - added by jschroeter 7 years ago.
Test file to pass an url with anchor via filebrowser. Copy into /_samples and open passing_urlanchor.html
5527.patch (494 bytes) - added by alfonsoml 7 years ago.
Proposed patch

Download all attachments as: .zip

Change History (10)

comment:1 Changed 7 years ago by garry.yao

  • Resolution set to invalid
  • Status changed from new to closed

WFM, we haven't make any change of the passing arguments.

Changed 7 years ago by jschroeter

Test file to pass an url with anchor via filebrowser. Copy into /_samples and open passing_urlanchor.html

comment:2 Changed 7 years ago by jschroeter

Hm, are you sure it's working for you? I tested it in FF, Chrome and IE8 on two machines. Now I found the reason: the function updateTargetElement() replaces the character '#' in the passed url by '%23'. What's the reason for replacing it? Or do I have to pass my url with the anchor in another way/format? I attached a test file for passing an url with anchor via a filebrowser.

comment:3 Changed 7 years ago by wwalc

  • Keywords Confirmed added
  • Resolution invalid deleted
  • Status changed from closed to reopened

Thanks for providing a nice example that helped me in reproducing it.

The problem is that you can have a file or a folder that contains # in it's name and this is the reason why it was introduced. Unfortunately this way anchors are broken.

comment:4 Changed 7 years ago by alfonsoml

This is related to the discussion in #5534. My point of view is that the server script is the one that must encode special chars because at CKEditor is not possible to know if the # means an anchor in an html document or is part of the file name.

So I vote for removing the current replacement of # and use just whatever the server sends.

comment:5 Changed 7 years ago by jschroeter

Alright, thanks for the explanation. I also think, that the encoding should be done on the server side.

Changed 7 years ago by alfonsoml

Proposed patch

comment:6 Changed 7 years ago by alfonsoml

  • Owner set to alfonsoml
  • Status changed from reopened to review

The patch just removes the encoding done in JS, and any such special characters must be encoded at the server because it's the only place where it can know if it's part of a file name or it marks an url fragment.

comment:7 Changed 5 years ago by wwalc

  • Milestone set to CKEditor 3.6.3
  • Status changed from review to review_passed

True, the encoding must be done in the external file browser, definitely not in CKEditor.

Another example just to prove that's the way to go - the following file has a perfectly valid name: sale_%20_off.jpg

CKEditor has no information whether it is actually sale_%20_off.jpg that needs to be encoded or sale_ _off.jpg that is already encoded properly.

Review+ (at the same time, we should review the encoding of URLs in CKFinder).

comment:8 Changed 5 years ago by alfonsoml

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7388]

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