gilbitron/Pico-Editor-Plugin — pull request #8 by sarxos (2013-09-16 17:04:33+00:00)
Title: Fix pico_editor when Pico installed within non-empty base_url

Hi,

First of all, thank you for awesome and very simple CMS as well as for a bunch of ready-to-use plugins.

I'm completely new in Pico, just started playing with it, but found an issue in _pico_editor_ when Pico has not been installed in the default, i.e. empty base URL.

My configuration is the following:

```php
$config = array(
'site_title' => 'Pico',
'base_url' => 'http://localhost/pico',
'theme' => 'default',
'date_format' => 'jS M Y',
'twig_config' => array('cache' => false, 'autoescape' => false, 'debug' => false),
'pages_order_by' => 'alpha',
'pages_order' => 'asc',
'excerpt_length' => 50
);
```

As you can see I do have Pico installed in sub directory called ```pico```. It works fine, but _pico_editor_ is having troubles whenever I'm trying to edit index.md file (it does not recognize it, even when default base URL is used).

The attached commit fix described problem with empty and non-empty base URL.

Tested on top of https://github.com/gilbitron/Pico/commit/45cd4ca5b7c35399f65065341a9676c629399a62

Works fine with any combination of base URL, but I tested this fix with the following configurations:

```plain
http://localhost
http://localhost/pico
http://localhost/services/pico
```