mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
Escape the completed localized notification before creating HTML line breaks and remove subject newlines so stored card, list, board, actor, comment, and translation values remain text. Thanks to binary-lover and xet7 !
17 lines
387 B
JavaScript
17 lines
387 B
JavaScript
'use strict';
|
|
|
|
function escapeEmailHtml(value) {
|
|
return String(value ?? '')
|
|
.replaceAll('&', '&')
|
|
.replaceAll('<', '<')
|
|
.replaceAll('>', '>')
|
|
.replaceAll('"', '"')
|
|
.replaceAll("'", ''');
|
|
}
|
|
|
|
function safeEmailSubject(value) {
|
|
return String(value ?? '').replace(/[\r\n]+/g, ' ').trim();
|
|
}
|
|
|
|
module.exports = { escapeEmailHtml, safeEmailSubject };
|