-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Right-clicking and creating new files or folders doesn't resolve paths for .. and / #11609
Comments
Nice find! I like how it sort of works how you would expect it to regarding creating files with relative paths and it also sort of works how you would expect it to work if they were just filenames. Another case that brings really weird behavior is naving a file I'd say the expected behavior would be showing a "filename cannot contain error", something similar to this Windows example: |
@petetnt, I had the same thought, to show a "filename cannot contain..." error of some kind. I don't think you want people using the filename as a way to bypass pathing. |
@peterflynn noted on the mailing list (Brackets-Dev) that error/validation is there already, but it's not in a tooltip form but a modal error that appears when there are invalid characters. The "/" case is just failing: |
Submitted a pull request : #11862 As @peterflynn pointed out , the validation is failing for this case. The reason being, the validation checks for the basename of the file which strips out the The pull request does change the inherent behavior of FileUtils.baseName though. It makes sense , cos if the fullpath contains the parent relative path , it should be returned along with the baseName. I preferred this over the option of creating a new function like |
This can be closed now. |
It's possible to right-click in the file tree and create a file (or filder) named
../something
or just..
, and the path isn't resolved, but rather the..
and/
characters are treated as literals to be used in the filename itself.First discovered by @Pomax in https://github.com/humphd/brackets/issues/434, and now I'm filing upstream, since this is really a bug in Brackets.
The text was updated successfully, but these errors were encountered: