From 600beb5af3e35fd82a2b06995b67629d08fe0fe3 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 15 Sep 2017 06:56:08 -0400 Subject: Add some checking of channel ID before sending websocket event (#7431) --- app/channel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/channel.go') diff --git a/app/channel.go b/app/channel.go index fa9ac08ef..e7025633f 100644 --- a/app/channel.go +++ b/app/channel.go @@ -1168,7 +1168,7 @@ func (a *App) ViewChannel(view *model.ChannelView, userId string, clearPushNotif return result.Err } - if *utils.Cfg.ServiceSettings.EnableChannelViewedMessages && len(view.ChannelId) > 0 { + if *utils.Cfg.ServiceSettings.EnableChannelViewedMessages && model.IsValidId(view.ChannelId) { message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userId, nil) message.Add("channel_id", view.ChannelId) go Publish(message) -- cgit v1.2.3-1-g7c22