Opened 15 years ago
Closed 13 years ago
#5527 closed Bug (fixed)
Anchor (#) in URL gets urlencoded when using CKEDITOR.tools.callFunction
Reported by: | Jakob | Owned by: | Alfonso Martínez de Lizarrondo |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.6.3 |
Component: | General | Version: | SVN (CKEditor) - OLD |
Keywords: | Confirmed | Cc: |
Description
When calling
CKEDITOR.tools.callFunction(2, "http://www.kajona.de/index.html#myanchor");
out of our custom filebrowser, CKEditor will convert the URL to
http://www.kajona.de/index.html%23myanchor
I guess this isn't a feature?
Attachments (2)
Change History (10)
comment:1 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Changed 15 years ago by
Attachment: | _samples.zip added |
---|
Test file to pass an url with anchor via filebrowser. Copy into /_samples and open passing_urlanchor.html
comment:2 Changed 15 years ago by
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 15 years ago by
Keywords: | Confirmed added |
---|---|
Resolution: | invalid |
Status: | closed → 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 15 years ago by
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 15 years ago by
Alright, thanks for the explanation. I also think, that the encoding should be done on the server side.
comment:6 Changed 14 years ago by
Owner: | set to Alfonso Martínez de Lizarrondo |
---|---|
Status: | reopened → 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 13 years ago by
Milestone: | → CKEditor 3.6.3 |
---|---|
Status: | review → 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 13 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [7388]
WFM, we haven't make any change of the passing arguments.