Permalink
Show file tree
Hide file tree
4 changes: 3 additions & 1 deletion
4
server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.java
4 changes: 3 additions & 1 deletion
4
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
3 changes: 2 additions & 1 deletion
3
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix the issue that uploaded file can be stored anywhere OneDev has write
permissions over
- Loading branch information
1 parent
7c15bf7
commit 0c06015
Showing
4 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
server-core/src/main/java/io/onedev/server/util/FilenameUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package io.onedev.server.util; | ||
|
|
||
| public class FilenameUtils extends org.apache.commons.io.FilenameUtils { | ||
|
|
||
| public static String sanitizeFilename(String fileName) { | ||
| return fileName.replace("..", "_").replace('/', '_').replace('\\', '_'); | ||
| } | ||
|
|
||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters