0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-25 16:20:27 +01:00
This commit is contained in:
Unknwon 2015-08-29 12:03:40 +08:00
parent 65843b803b
commit 5ddcd8420b

View File

@ -43,12 +43,13 @@ var gravatarSource string
func UpdateGravatarSource() {
gravatarSource = setting.GravatarSource
log.Debug("avatar.UpdateGravatarSource(gavatar source): %s", gravatarSource)
if !strings.HasPrefix(gravatarSource, "http://") ||
if strings.HasPrefix(gravatarSource, "//") {
gravatarSource = "http:" + gravatarSource
} else if !strings.HasPrefix(gravatarSource, "http://") ||
!strings.HasPrefix(gravatarSource, "https://") {
gravatarSource = "http://" + gravatarSource
log.Debug("avatar.UpdateGravatarSource(update gavatar source): %s", gravatarSource)
}
log.Debug("avatar.UpdateGravatarSource(update gavatar source): %s", gravatarSource)
}
// hash email to md5 string