-
- Downloads
Add ability to create directories in the editor
Simply type a name with a `/` directory separator and new directories will be created. This does not do the fancy UI work that github.com does, but it will get the job done. I could not find tests for file creation, so I didn't add a test for this slight behaviour modification. I did test directory traversals though, using both absolute paths like `/tmp/foo.txt` and relative paths like `../../foo.txt`. Neither case escaped the repository, though attempting to traverse with a relative path resulted in a 500 error that did not affect application stability upon reload.
Showing
- CHANGELOG 3 additions, 0 deletionsCHANGELOG
- app/assets/stylesheets/pages/editor.scss 1 addition, 1 deletionapp/assets/stylesheets/pages/editor.scss
- app/controllers/projects/blob_controller.rb 1 addition, 1 deletionapp/controllers/projects/blob_controller.rb
- app/services/files/create_dir_service.rb 11 additions, 0 deletionsapp/services/files/create_dir_service.rb
- app/services/files/create_service.rb 8 additions, 3 deletionsapp/services/files/create_service.rb
- features/project/source/browse_files.feature 10 additions, 0 deletionsfeatures/project/source/browse_files.feature
- features/steps/project/source/browse_files.rb 15 additions, 0 deletionsfeatures/steps/project/source/browse_files.rb
- lib/gitlab/regex.rb 17 additions, 0 deletionslib/gitlab/regex.rb
Loading
Please register or sign in to comment