diff --git a/back/models/chat.js b/back/models/chat.js index 5eb986a2c..b75900ebd 100644 --- a/back/models/chat.js +++ b/back/models/chat.js @@ -12,6 +12,8 @@ module.exports = Self => { if (!message) return; const parts = message.match(/(?<=\[)[a-zA-Z0-9!@#$%^&*()={};':"\\|,.<>/?\s]*(?=])/g); + if (!parts) return; + const replacedParts = parts.map(part => { return part.replace(/[!@#$%^&*()={};':"\\|,.<>/?]/g, ''); });