diff options
author | Marios Andreopoulos <opensource@andmarios.com> | 2014-08-25 21:07:08 +0300 |
---|---|---|
committer | Marios Andreopoulos <opensource@andmarios.com> | 2014-08-25 21:07:08 +0300 |
commit | 510d5a5d74301ad0083b1ea10aef6caa17cde8d8 (patch) | |
tree | c36c81a63b70912bced8477c8a72fb741be5270b /routers/user/setting.go | |
parent | cd0ddcfa01ea06ff64e4a05032f718a4b3097c25 (diff) | |
download | gitea-510d5a5d74301ad0083b1ea10aef6caa17cde8d8.tar.gz gitea-510d5a5d74301ad0083b1ea10aef6caa17cde8d8.zip |
import strings
Diffstat (limited to 'routers/user/setting.go')
-rw-r--r-- | routers/user/setting.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go index 37039041c4..d3b792134d 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -5,6 +5,8 @@ package user import ( + "strings" + "github.com/Unknwon/com" "github.com/gogits/gogs/models" @@ -172,7 +174,7 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) { } // Remove newline characters from form.KeyContent - cleanContent := string.Replace(form.Content, "\n", "", -1) + cleanContent := strings.Replace(form.Content, "\n", "", -1) if ok, err := models.CheckPublicKeyString(cleanContent); !ok { ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error())) |