1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-16 15:14:24 +00:00
This commit is contained in:
Marios Andreopoulos 2014-08-25 20:35:23 +03:00
parent 3d79f59671
commit cd0ddcfa01

View File

@ -172,7 +172,7 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
} }
// Remove newline characters from form.KeyContent // Remove newline characters from form.KeyContent
cleanContent := strings.Replace(form.Content, "\n", "", -1) cleanContent := string.Replace(form.Content, "\n", "", -1)
if ok, err := models.CheckPublicKeyString(cleanContent); !ok { if ok, err := models.CheckPublicKeyString(cleanContent); !ok {
ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error())) ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error()))