only embed signature if its html, otherwise just write it
This commit is contained in:
@@ -292,8 +292,12 @@ ${html_entities.encode((message.subject) ? message.subject : '(No subject)')}
|
|||||||
data += `
|
data += `
|
||||||
${html_entities.encode(message.body).replace("\n", "<br>")}
|
${html_entities.encode(message.body).replace("\n", "<br>")}
|
||||||
<br>
|
<br>
|
||||||
${(message.signature) ? '<embed src="wtv-mail:/get-signature?message_id='+messageid+'">' : ''}
|
<br>`;
|
||||||
<p>
|
if (message.signature) {
|
||||||
|
if (wtvshared.isHTML(message.signature)) data += `<embed src="wtv-mail:/get-signature?message_id='+messageid+'">`;
|
||||||
|
else data += message.signature;
|
||||||
|
}
|
||||||
|
data += `<p>
|
||||||
<p>
|
<p>
|
||||||
</table>
|
</table>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -412,7 +412,8 @@ vlink=#62B362
|
|||||||
vspace=0
|
vspace=0
|
||||||
hspace=0>`;
|
hspace=0>`;
|
||||||
if (ssid_sessions[socket.ssid].getSessionData("subscriber_signature") && ssid_sessions[socket.ssid].getSessionData("subscriber_signature") != "" && !no_signature) {
|
if (ssid_sessions[socket.ssid].getSessionData("subscriber_signature") && ssid_sessions[socket.ssid].getSessionData("subscriber_signature") != "" && !no_signature) {
|
||||||
data += `<embed src="wtv-mail:/get-signature" transparent>`;
|
if (wtvshared.isHTML(ssid_sessions[socket.ssid].getSessionData("subscriber_signature"))) data += `<embed src="wtv-mail:/get-signature" transparent>`;
|
||||||
|
else data += ssid_sessions[socket.ssid].getSessionData("subscriber_signature");
|
||||||
}
|
}
|
||||||
data += `
|
data += `
|
||||||
<td abswidth=2 bgcolor=#000000>
|
<td abswidth=2 bgcolor=#000000>
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ class WTVShared {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isHTML(str) {
|
||||||
|
return /<\s*([^ >]+)[^>]*>.*?<\s*\/\s*\1\s*>/.test(str);
|
||||||
|
}
|
||||||
|
|
||||||
returnAbsolutePath(check_path) {
|
returnAbsolutePath(check_path) {
|
||||||
if (check_path.substring(0, 1) != this.path.sep && check_path.substring(1, 1) != ":") {
|
if (check_path.substring(0, 1) != this.path.sep && check_path.substring(1, 1) != ":") {
|
||||||
// non-absolute path, so use current directory as base
|
// non-absolute path, so use current directory as base
|
||||||
|
|||||||
Reference in New Issue
Block a user