MM-51486: Implementing UTS 46 to check for preview blocklist (#22601)
There is a standard IDNA2008 which defines how unicode characters in domain names can be compared using UTS (Unicode Technical Standard) 46. We use that to convert any links in messages to ASCII and then compare with the domain list in config. https://mattermost.atlassian.net/browse/MM-51486 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c943ed6859
Коммит
19c7c6fa7a
@@ -356,12 +356,6 @@ func (a *App) CreateTeamWithUser(c *request.Context, team *model.Team, userID st
|
||||
return rteam, nil
|
||||
}
|
||||
|
||||
func (a *App) normalizeDomains(domains string) []string {
|
||||
// commas and @ signs are optional
|
||||
// can be in the form of "@corp.mattermost.com, mattermost.com mattermost.org" -> corp.mattermost.com mattermost.com mattermost.org
|
||||
return strings.Fields(strings.TrimSpace(strings.ToLower(strings.Replace(strings.Replace(domains, "@", " ", -1), ",", " ", -1))))
|
||||
}
|
||||
|
||||
func (a *App) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) {
|
||||
oldTeam, err := a.ch.srv.teamService.UpdateTeam(team, teams.UpdateOptions{Sanitized: true})
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user