LinkItemCollection issue

Vote:
 

Hello!

While using the LinkItemCollection property I`ve encountered a weird issue.

If I try to add a new linkItem using the external url , e.g. 

https://estest.livingspaces.com/departments/furniture/bedroom/beds?sizes=california+king

This will be saved in the DB as “<links><a href="~/link/33dd54ea609d4544a2f4d5cefb027277.aspx?sizes=california+king"> Link</a></links>”

If you edit that link in the cms you will see in the Remaining Url field the encoded value.

After making any update on this block where the link item collection is used, in the DB the value for the link will be updated like this : <links><a href="~/link/33dd54ea609d4544a2f4d5cefb027277.aspx?sizes=california%20kingupdate">Link</a></links>.

It will automatically encode the +  to %20 ( which is not even the correct encoding value for +).

Is this issue known ? 
Has anybody else encountered this issue before?

#316013
Jan 22, 2024 13:38
Vote:
 

Percent encoding is correct. Please see https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20. "Escaping" spaces in the query with + is for backwards compatability.

If you actully want to escape + and not treat it as a space, then you need to escape it before saving it. You need to pass in https://estest.livingspaces.com/departments/furniture/bedroom/beds?sizes=california%2Bking.

#316063
Jan 23, 2024 8:23
Vote:
 

I have asked our QAs to verify this behavior and they will log a bug for it if necessary

#316073
Edited, Jan 23, 2024 9:51
Vote:
 

@Quan Mai thank you! 
Please keep me updated.

#316074
Jan 23, 2024 9:53
Quan Mai - Jan 23, 2024 14:11
as commented by my colleague @Johan, this behavior seems to be "as designed"
Vote:
 

I just tested this in EPiServer.CMS 12.26.0, by just suppling a 'Remaining URL', and this is the results I got:
?sizes=california king > ?sizes=california%20king
?sizes=california%20king > ?sizes=california%20king
?sizes=california+king > ?sizes=california%2Bking
?sizes=california%2Bking > ?sizes=california%2Bking

All these cases seems right to me. Since we're percent encoding internally. But there might be issues when providing an internal URL via the 'External link' field. Then we're assuming that the URL is already escaped, i.e. + will be unescpaed to space and then percent encoded as %20.

#316084
Jan 23, 2024 14:00
Vote:
 

@Johan You are correct. "But there might be issues when providing an internal URL via the 'External link' field." This is what we are encountering. Do you have any suggestions here ?

#316169
Jan 25, 2024 14:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.