mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix: prevents blank messages from being posted to chat (#8257)
* fix: throws an error when the server receives a post chat request with a message containing only whitespace. * Adding a test confirming behavior around messages that only contain newlines. * Removing accidental only that was left on a test
This commit is contained in:
@@ -93,6 +93,7 @@ api.postChat = {
|
||||
let chatUpdated;
|
||||
|
||||
req.checkParams('groupId', res.t('groupIdRequired')).notEmpty();
|
||||
req.sanitize('message').trim();
|
||||
req.checkBody('message', res.t('messageGroupChatBlankMessage')).notEmpty();
|
||||
|
||||
let validationErrors = req.validationErrors();
|
||||
|
||||
Reference in New Issue
Block a user