NormalizeUserRealName normalizes a user name such that it will pass validation by UserRealNameValid. This is done to avoid blocking little Bobby Whitespace from using Coder.
(str string)
| 122 | // validation by UserRealNameValid. This is done to avoid blocking |
| 123 | // little Bobby Whitespace from using Coder. |
| 124 | func NormalizeRealUsername(str string) string { |
| 125 | s := strings.TrimSpace(str) |
| 126 | if len(s) > 128 { |
| 127 | s = s[:128] |
| 128 | } |
| 129 | return s |
| 130 | } |
no outgoing calls