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

Be more strict with git arguments #7715

Merged
merged 10 commits into from
Aug 5, 2019
3 changes: 2 additions & 1 deletion routers/repo/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ func NewFile(ctx *context.Context) {
func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bool) {
canCommit := renderCommitRights(ctx)
treeNames, treePaths := getParentTreeFields(form.TreePath)
branchName := ctx.Repo.BranchName
branchName := path.Clean("/" + ctx.Repo.BranchName)[1:]
lafriks marked this conversation as resolved.
Show resolved Hide resolved
form.NewBranchName = path.Clean("/" + form.NewBranchName)[1:]
if form.CommitChoice == frmCommitChoiceNewBranch {
branchName = form.NewBranchName
}
Expand Down