OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

url encoding in slugs #3832

Open orchardbot opened 11 years ago

orchardbot commented 11 years ago

boomhauer created: https://orchard.codeplex.com/workitem/20004

I tried writing a blog post about specific url encodings that show up sometimes, and thus I wanted specific percent encoded strings to show up... IN the url...

This actually causes the slug to not work.

ie, I would like a slug to literally show something like "/what-does-%20-mean"

orchardbot commented 11 years ago

@bleroy commented:

Please explain what exact slug you entered and what the result was.

orchardbot commented 11 years ago

boomhauer commented:

I tried creating an article titled "%E2%80%8B", so that the url would look like url.com/%E2%80%8B . The page could not be found.

It is a slightly older site though, so this may be repaired now.

orchardbot commented 11 years ago

@bleroy commented:

I don't understand. Why don't you use the real characters that you want?

orchardbot commented 10 years ago

@sebastienros commented:

\ Closed by sebastienros 12/03/2013 1:02PM

orchardbot commented 10 years ago

@sebastienros commented:

You can also provide you custom logic for slug generation

orchardbot commented 10 years ago

boomhauer commented:

Because the article was about url encoding!

But it proves a point that even if a % is found in the url slug somewhere, I think it will not work correctly. it should be encoded in any case, since it will be used in a url. My test case proved this was not working.

orchardbot commented 10 years ago

boomhauer commented:

If you decide this doesn't need to be implemented, then you are deciding the system is ok with a bug in it.

orchardbot commented 10 years ago

@sebastienros commented:

If you want the url to look like this, then you should just set it in the slug text, once it's generated. It should work. If it doesn't work then this is a bug.

Repro steps:

Expected result: The slug should not be '%E2%80' and no validation should occur and the page should be accessible through /%E2%80

orchardbot commented 10 years ago

boomhauer commented:

I actually want the title to be this too. Again, I'm running an older version so this may already work in the newer ones, but if not, it's a bug.

I'll create a couple test cases that fail and post them here.

orchardbot commented 10 years ago

boomhauer commented:

I just reproduced this.

-created blog post with title "%e2%80%8b" -left slug as default, also: "%e2%80%8b" -post is saved and shows on the blog page as a new post. The title is displayed correctly, and the preview text for the post also is shown. -Click the link to the post and I get a "resource cannot be found" 404 page. -The link to the post has the correct url encoding, with the original percents encoded, so link is: http://thesiteurl.com/%25e2%2580%258b

Definitely a bug, at least in my older version.

orchardbot commented 10 years ago

@jetski5822 commented:

Do you know what version you are using out of interest?

orchardbot commented 10 years ago

boomhauer commented:

I believe i'm running 1.3, pretty old...

orchardbot commented 10 years ago

@sebastienros commented:

Todo: try to repro on 1.8.x

agriffard commented 8 years ago

Try to repro and test if it is fixed.