picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.86k stars 616 forks source link

annoying BUG #194

Closed PhoenixPeca closed 9 years ago

PhoenixPeca commented 9 years ago

I cant make a browse to a url with space(%20) for example, I made a file with space; let's say I named it "Hello World". Then I tried to browse it on my browser, and I get an error!!!!


| < > C | http://localhost/Hello%20World | E | _____ |

HAHAHAHAH I'm TERROR!!!!! AND I JUST GAVE YOU GET A 404 ERROR !!!!

elbotho commented 9 years ago

Ok. If you are indeed not trolling:
This is not a bug and this is not specific for Pico.
See http://stackoverflow.com/questions/497908/is-a-url-allowed-to-contain-a-space or http://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid

PhoenixPeca commented 9 years ago

OHHH!!! sorry for my post for I added a joke(You just misinterpreted it as an issue unrelated to PICO). I thought it was funny. LET ME CLEAR THIS.

untitled

What I mean is that I created a page inside the content folder.. The page was named Welcome to My Website,

untitled1

It was listed in the navigation bar,

untitled2

but when I clicked the link in the navigation bar I got a 404 error. Just try it for yourself and see what I mean...

elbotho commented 9 years ago

The links I posted tell you that you shouldn't use spaces in urls.
To solve your Problem rename the
Welcome to My Website.md-file to
Welcome_to_My_Website.md or something else without spaces.

PhoenixPeca commented 9 years ago

That makes sense. I understand your point. But in my humble opinion, It's not just my problem, It's every user's problem.

If it's not a bug then why can't Pico CMS identify markdown file named with spaces so that it can exclude it in the listing in the navigation bar? I didn't even received a warning saying "The Markdown File you Created has spaces and Pico doesn't know how to deal with it or similar for debugging purposes. All I get is a 404 error saying the file doesn't exist in the content folder, in fact it do exist."

I tried another CMS (Grav) to find the same problem but I can't find the problem with Grav, I think it is Pico's problem. The developer of Pico should write a code that deals with this problem. Of course not all people know that as much as possible he/she should not use spaces in naming files in the internet unless they know what and how to use (%20) is, right? Sadly Pico doesn't support (%20), however, I expect this to be fixed in the next release of Pico. Anyway, this is just a simple problem, there's no big deal. If you insist to consider this a bug. It's up to you. I understand your point. Thank You!! and Merry Christmas.

I'm sorry for my English if you find it wrong in terms of grammar.

bricebou commented 9 years ago

I'm not sure, but maybe it's not a Pico's problem... Have you tried to read the documentation for htaccess ? Maybe there is a way to use a rewrite rule that changes spaces to the right unicode character ?

PhoenixPeca commented 9 years ago

OKAY! :)

dav-m85 commented 9 years ago

That's no big deal, Pico is just not url_decode-ing the url before doing the file lookup. You should issue a PR quite easily on this one.