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

Allow path traversal in file explorer #113

Merged
merged 8 commits into from
Dec 27, 2018

Conversation

SachsKaylee
Copy link

Hello there!

I stumbled upon Jodit a few days ago and it seems like a really awesome editor. I didn't expect this from a library that isn't hugely popular.

However I didn't like an aspect of the file browser: I can only move forward, not backwards(e.g. a folder path like ..).

This way I can write code like this in my backend, adding a .. back option for all non-root paths:

return res.sendData({
      data: {
        success: true,
        time: new Date().toISOString(),
        data: {
          messages: [],
          sources: {
            [source]: {
              path: path,
              baseurl: "/api/files/serve/",
              folders: split.length ? ["..", ...dirs] : dirs
            }
          },
          //  ....
        }
      }
    });

Am I misunderstanding how the filebrowser should be used or is a "go to parent folder" like functionality currently missing from the file browser?


[ / ] There is an associated issue that is labelled 'Bug' or 'help wanted' or is in the Community milestone
[ X ] Code is up-to-date with the master branch
[ X ] You've successfully run npm test locally
[ / ] There are new or updated tests validating the change - Will create if this change is desired in upstream.

@SachsKaylee
Copy link
Author

It was also impossible to upload files without extension, e.g. "my-file" - I took the liberty to fix this. It is perfectly normal for files to not have an extension on Unix platforms.

Files are now uploaded even if they do not have an extension.

@xdan xdan merged commit f1080ac into xdan:master Dec 27, 2018
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.

2 participants