mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 10:35:15 +01:00
Properly escape plain text
This commit is contained in:
@@ -20,6 +20,7 @@ package eu.faircode.email;
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
@@ -809,8 +810,11 @@ public class MessageHelper {
|
||||
warnings.add(context.getString(R.string.title_no_charset, charset));
|
||||
}
|
||||
|
||||
if (part.isMimeType("text/plain") || text)
|
||||
result = "<span>" + result.replaceAll("\\r?\\n", "<br />") + "</span>";
|
||||
if (part.isMimeType("text/plain") || text) {
|
||||
result = Html.escapeHtml(result);
|
||||
result = result.replaceAll("\\r?\\n", "<br />");
|
||||
result = "<span>" + result + "</span>";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user