LinwoodDev / Butterfly

🎨 Powerful, minimalistic, cross-platform, opensource note-taking app
https://butterfly.linwood.dev
GNU Affero General Public License v3.0
980 stars 67 forks source link

prevented creation of files outside of a folder #714

Closed MrGumpIT closed 4 months ago

MrGumpIT commented 4 months ago

it was not possible to create a file, except inside a subfolder

vercel[bot] commented 4 months ago

@MrGumpIT is attempting to deploy a commit to the Linwood Team on Vercel.

A member of the Team first needs to authorize it.

CodeDoctorDE commented 4 months ago

https://pub.dev/documentation/path/latest/path/split.html i don't understand, this should do the same?

MrGumpIT commented 4 months ago

i add some print for test, and this is the result: Restarted application in 1.343ms. flutter: dynamic_color: Accent color detected. flutter: Original path: /test2.bfly flutter: Path split using /: [, test2.bfly] flutter: Path split using p.split: [/, test2.bfly] flutter: Running on platform: windows flutter: Document is cached, updating cache content. flutter: Directory path: / flutter: Creating request to overwrite the file at: /test2.bfly flutter: Request URL parts: [/, test2.bfly] flutter: Request method: PUT

CodeDoctorDE commented 4 months ago

But the slash also exist on split. Maybe we should remove the leading slash before with an if condition?

MrGumpIT commented 4 months ago

if I remove/it works, I remove it just for the request

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
butterfly ✅ Ready (Inspect) Visit Preview May 24, 2024 8:29am
CodeDoctorDE commented 4 months ago

thanks for contributing!