mirror of
https://github.com/chatmail/core.git
synced 2026-05-18 22:36:29 +03:00
fix: Correctly sanitize input everywhere (#5697)
Best reviewed commit-by-commit; the commit messages explain what is done.
This commit is contained in:
@@ -183,8 +183,8 @@ mod tests {
|
||||
Message-ID: <msg3@example.org>\n\
|
||||
Chat-Version: 1.0\n\
|
||||
Chat-Group-ID: abcde123456\n\
|
||||
Chat-Group-Name: another name update\n\
|
||||
Chat-Group-Name-Changed: a name update\n\
|
||||
Chat-Group-Name: =?utf-8?q?another=0Aname update?=\n\
|
||||
Chat-Group-Name-Changed: =?utf-8?q?a=0Aname update?=\n\
|
||||
Date: Sun, 22 Mar 2021 03:00:00 +0000\n\
|
||||
\n\
|
||||
third message\n",
|
||||
@@ -198,7 +198,7 @@ mod tests {
|
||||
Message-ID: <msg2@example.org>\n\
|
||||
Chat-Version: 1.0\n\
|
||||
Chat-Group-ID: abcde123456\n\
|
||||
Chat-Group-Name: a name update\n\
|
||||
Chat-Group-Name: =?utf-8?q?a=0Aname update?=\n\
|
||||
Chat-Group-Name-Changed: initial name\n\
|
||||
Date: Sun, 22 Mar 2021 02:00:00 +0000\n\
|
||||
\n\
|
||||
@@ -210,6 +210,9 @@ mod tests {
|
||||
let chat = Chat::load_from_db(&t, msg.chat_id).await?;
|
||||
assert_eq!(chat.name, "another name update");
|
||||
|
||||
// Assert that the \n was correctly removed from the group name also in the system message
|
||||
assert_eq!(msg.text.contains('\n'), false);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user