Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to see content in subfolders? #17

Open
nclm opened this issue Nov 18, 2014 · 4 comments
Open

Unable to see content in subfolders? #17

nclm opened this issue Nov 18, 2014 · 4 comments

Comments

@nclm
Copy link

nclm commented Nov 18, 2014

It seems that Pico Editor doesn’t get content pages that are in ‘categories’ i.e. in a subfolder of /content.
For instance /content/projects/project1.md is not displayed in the editor. There’s an ‘Untitled’ line which may be this, but the content is said to be ‘unvalid’.

@w-vi
Copy link

w-vi commented Nov 18, 2014

There is couple of bugs related to handling of subfolders, see the pull request, so patch it first as it may be connected.

@glasswork
Copy link

Bump on this issue.
Any plans to fix the 'Error: invalid file' issue for files in subfolders of 'content' folder?

@nyanpasu64
Copy link

Fix for bug: #20

@AeonFr
Copy link

AeonFr commented Nov 25, 2015

Change line 292 of PicoEditor.php

$file = basename(strip_tags($file_url));

into

$file = substr(strip_tags($file_url), 1);

basename()was removing the sub-folder, aditionaly, the urls where being requested with double slash (example.com//page), that might have security implications according to this stackoverflow answer.

Edit:
I've discovered there's another bug related with sub-folders. If you delete "/?sub/page", "/?page" will be deleted instead! Also, when editing "/?sub/page", "/?page" will be overriden.

This is again caused by the basename function wich will output page given "/testweb/page.php" or "/page.php" (it removes the sub-folder part of the query)

Replace line 320 and 394 with $file = substr(strip_tags($file_url), 1);

Note: I've just realized I've posted this in the wrong repo xD my version of PicoEditor is the one from this repo wich is also the one linked in (picocms.org/plugins.html)[http://picocms.org/plugins.html]. Sorry for this, it may not work at all. 😭

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

No branches or pull requests

5 participants