mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
fix reaction's name validation with + sign in it (#6221)
This commit is contained in:
committed by
Harrison Healey
parent
f9502ff14b
commit
6fa7082833
@@ -6,6 +6,7 @@ package api4
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -504,7 +505,9 @@ func (c *Context) RequireEmojiName() *Context {
|
||||
return c
|
||||
}
|
||||
|
||||
if len(c.Params.EmojiName) == 0 || len(c.Params.EmojiName) > 64 || !model.IsValidAlphaNumHyphenUnderscore(c.Params.EmojiName, false) {
|
||||
validName := regexp.MustCompile(`^[a-zA-Z0-9\-\+_]+$`)
|
||||
|
||||
if len(c.Params.EmojiName) == 0 || len(c.Params.EmojiName) > 64 || !validName.MatchString(c.Params.EmojiName) {
|
||||
c.SetInvalidUrlParam("emoji_name")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user