mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-11516: Check channel ID in URL param and Body are same. (#9185)
This commit is contained in:
committed by
Harrison Healey
parent
82dfe9e61d
commit
a6c364822a
@@ -90,6 +90,12 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// The channel being updated in the payload must be the same one as indicated in the URL.
|
||||
if channel.Id != c.Params.ChannelId {
|
||||
c.SetInvalidParam("channel_id")
|
||||
return
|
||||
}
|
||||
|
||||
var oldChannel *model.Channel
|
||||
var err *model.AppError
|
||||
if oldChannel, err = c.App.GetChannel(channel.Id); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user