1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Sanitize credentials in mirror form (#9975) (#9991)

This commit is contained in:
Lunny Xiao
2020-01-26 16:16:53 +08:00
committed by zeripath
parent 16f7b43903
commit 16dfd9ffbe
4 changed files with 37 additions and 1 deletions

View File

@@ -204,6 +204,14 @@ type Repository struct {
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
}
// SanitizedOriginalURL returns a sanitized OriginalURL
func (repo *Repository) SanitizedOriginalURL() string {
if repo.OriginalURL == "" {
return ""
}
return util.SanitizeURLCredentials(repo.OriginalURL, false)
}
// ColorFormat returns a colored string to represent this repo
func (repo *Repository) ColorFormat(s fmt.State) {
var ownerName interface{}