diff options
author | Wim <wim@42.be> | 2019-11-17 21:42:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-17 21:42:41 +0100 |
commit | d4253d7a55f7af862304fb65c461547055dd294a (patch) | |
tree | 8a8c5ed06841ea2bd3a24639dcd5462cfdbfea32 /vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go | |
parent | 0917dc876613fd71c9726a34bf0138b4f5121be9 (diff) | |
download | matterbridge-msglm-d4253d7a55f7af862304fb65c461547055dd294a.tar.gz matterbridge-msglm-d4253d7a55f7af862304fb65c461547055dd294a.tar.bz2 matterbridge-msglm-d4253d7a55f7af862304fb65c461547055dd294a.zip |
Update shazow/ssh-chat dependency (#947)
Diffstat (limited to 'vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go')
-rw-r--r-- | vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go b/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go index ed532c97..4f9775f8 100644 --- a/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go +++ b/vendor/github.com/shazow/ssh-chat/internal/sanitize/sanitize.go @@ -2,7 +2,10 @@ package sanitize import "regexp" -var reStripName = regexp.MustCompile("[^\\w.-]") +var ( + reStripName = regexp.MustCompile("[^\\w.-]") + reStripData = regexp.MustCompile("[^[:ascii:]]|[[:cntrl:]]") +) const maxLength = 16 @@ -17,8 +20,6 @@ func Name(s string) string { return s } -var reStripData = regexp.MustCompile("[^[:ascii:]]|[[:cntrl:]]") - // Data returns a string with only allowed characters for client-provided metadata inputs. func Data(s string, maxlen int) string { if len(s) > maxlen { |