mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-15 22:50:11 +00:00
Do not strip newlines from email bodies
This commit is contained in:
@@ -850,7 +850,7 @@ void ChatManager::announcementHandler(CNSocket* sock, CNPacketData* data) {
|
||||
}
|
||||
|
||||
// we only allow plain ascii, at least for now
|
||||
std::string ChatManager::sanitizeText(std::string text) {
|
||||
std::string ChatManager::sanitizeText(std::string text, bool allowNewlines) {
|
||||
int i;
|
||||
char buf[128];
|
||||
|
||||
@@ -858,6 +858,10 @@ std::string ChatManager::sanitizeText(std::string text) {
|
||||
for (char c : text) {
|
||||
if (i >= 127)
|
||||
break;
|
||||
|
||||
if (!allowNewlines && c == '\n')
|
||||
continue;
|
||||
|
||||
if (c >= ' ' && c <= '~')
|
||||
buf[i++] = c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user