dullage / flatnotes

A self-hosted, database-less note taking web app that utilises a flat folder of markdown files for storage.
MIT License
1.5k stars 87 forks source link

Notes tiled ".", ".." or containing URL/percent encoded characters are innaccesible after creation #209

Closed danielmcmillan closed 4 months ago

danielmcmillan commented 4 months ago

When a note is created with title "." and "..", they appear on the filesystem as "..md" and "...md" respectively. This is normal, but then trying to access those via the browser will take you to "/note/" or "/". They are still accessible via API.

When a note is created containing a URL encoded character, such as "a%3Db" (decodes to a=b), it is treated as a literal string as expected and appears on the filesystem as "a%3Db.md". However, when trying to access the note from the browser at the expected URL with the percent symbol being encoded "/note/a%253Db" the note cannot be found. The API request being sent is for "a=b", so it may be that the name from the URL is incorrectly being decoded a second time. The note can be accessed by double-encoding the note name in the url "/note/a%25253Db".

dullage commented 4 months ago

Thanks. Fixed in this commit and will be in the next release.