Skip to content

Conversation

@sarxos
Copy link

@sarxos sarxos commented Sep 16, 2013

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:

$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 picocms/Pico@45cd4ca

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

http://localhost
http://localhost/pico
http://localhost/services/pico

@tyeeman
Copy link

tyeeman commented Oct 31, 2013

Thanks for this. I tried it and found it adds backslashes in certain words or image links. Try adding a markdown image link on a page, then edit the page and save and see what happens to the link.

@w-vi
Copy link

w-vi commented Jan 10, 2014

Good one, I came across the same thing and merged your fix, although I changed it a bit as the basename() returns only the trailing part of the path so if the file is in subdirectory it gets stripped just to filename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants