diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-12-15 11:03:35 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-12-16 15:48:42 +0100 |
| commit | 2b99a36921171bd66eefae03d494d0fbf8618932 (patch) | |
| tree | 257c536b3f3af9c9397633a381bdfd0e8a4e5602 /addons/mail/static/src/js/window_manager.js | |
| parent | f5e4fbb20c095f5fe197bac8da3157ded568c1c4 (diff) | |
[FIX] mail: sent messages are plaintext
The problem was that users couldn't write characters like <, > in their
messages because the messages are html (e.g. '3 < 5' resulted in '3' because
this wasn't html valid so the second part was trimmed).
Because of mentions, we can't force messages to be plaintext (mentions are
processed and replaced by html links before the message is stored in DB).
The solution is to escape them just before processing the mentions. In the case
of chat windows, we must be careful because chat windows are also used for the
livechat, for which messages are plaintext. So the escaping should be done for
chat windows in the backend, but not in the livechat.
Diffstat (limited to 'addons/mail/static/src/js/window_manager.js')
| -rw-r--r-- | addons/mail/static/src/js/window_manager.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/window_manager.js b/addons/mail/static/src/js/window_manager.js index fe60dff4bd5..f217d929c20 100644 --- a/addons/mail/static/src/js/window_manager.js +++ b/addons/mail/static/src/js/window_manager.js @@ -38,6 +38,7 @@ function open_chat (session) { }); chat_session.window.on("post_message", null, function (message, channel_id) { + message.content = _.escape(message.content); chat_manager.post_message(message, {channel_id: channel_id}); }); chat_session.window.on("messages_read", null, function () { |
