picocms / Pico

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

add support for windows path on evaluateRequestUrl() method #452

Closed bitmarte closed 5 years ago

bitmarte commented 5 years ago

On evaluateRequestUrl() method we need to consider the windows way to describe a path. In fact it uses slash instead of back-slash. With this fix we can use PicoCMS on both platform.

PhrozenByte commented 5 years ago

Ok, wow, PHP is sometimes really weird... I didn't really understand this patch so I investigated a bit, and it's true: If $_SERVER['SCRIPT_NAME'] = "/index.php"; (and it looks like this is the only situation), dirname($_SERVER['SCRIPT_NAME']); returns \ under Windows. Who knows why, but e.g. /pico/index.php results in /pico. Weird...

Can you please remove the CHANGELOG.md changes or update it to the following?

### Version 2.0.2
Released: -
PhrozenByte commented 5 years ago

Great, thank you for your contribution! :+1:

bitmarte commented 5 years ago

Hi @PhrozenByte , you need to publish a new release to packagist.org in order to include our fix. In fact when I try to install pico from composer I retrieve the previous version, so I must to override the source from my vendor dist folder.

PhrozenByte commented 5 years ago

@bitmarte: Sorry, it took some time, unfortunately my time is very limited at the moment. Here we go: https://github.com/picocms/Pico/releases/tag/v2.0.2

For some reason all Travis builds fail, Travis seems to have massive network problems right now (sometimes resulting in network-related errors, sometimes in stalling and time outs). :unamused: I've tried it >10 times over roughtly 3 hours, but it still doesn't work. Thus there's no pre-built release package yet. I'll try again in a couple of hours... composer-based installations aren't affected by this.

Thanks again! :+1: