Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
parent
4a71d4de68
commit
480efbdb96
1 changed files with 3 additions and 0 deletions
|
@ -97,6 +97,9 @@ func (f MigrateRepoForm) ParseRemoteAddr(user *models.User) (string, error) {
|
||||||
u.User = url.UserPassword(f.AuthUsername, f.AuthPassword)
|
u.User = url.UserPassword(f.AuthUsername, f.AuthPassword)
|
||||||
}
|
}
|
||||||
remoteAddr = u.String()
|
remoteAddr = u.String()
|
||||||
|
if u.Scheme == "git" && u.Port() != "" && (strings.Contains(remoteAddr, "%0d") || strings.Contains(remoteAddr, "%0a")) {
|
||||||
|
return "", models.ErrInvalidCloneAddr{IsURLError: true}
|
||||||
|
}
|
||||||
} else if !user.CanImportLocal() {
|
} else if !user.CanImportLocal() {
|
||||||
return "", models.ErrInvalidCloneAddr{IsPermissionDenied: true}
|
return "", models.ErrInvalidCloneAddr{IsPermissionDenied: true}
|
||||||
} else if !com.IsDir(remoteAddr) {
|
} else if !com.IsDir(remoteAddr) {
|
||||||
|
|
Reference in a new issue