From cc591baa3873425108dbcc188a2783930e971fbf Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 21 Aug 2019 17:37:03 +0200 Subject: [PATCH] Increase maximum message size / number of links --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 0a552499ea..1ec79d30de 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -76,8 +76,8 @@ import static androidx.core.text.HtmlCompat.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE; public class HtmlHelper { static final int PREVIEW_SIZE = 250; // characters - private static final int MAX_LINKS = 50; - private static final int MAX_SIZE = 50 * 1024; // characters + private static final int MAX_SIZE = 100 * 1024; // characters + private static final int MAX_LINKS = 500; private static final int TRACKING_PIXEL_SURFACE = 25; // pixels private static final List heads = Collections.unmodifiableList(Arrays.asList( @@ -126,9 +126,12 @@ public class HtmlHelper { } } + int size = parsed.text().length(); int links = parsed.select("a").size(); - if (links > MAX_LINKS || parsed.text().length() > MAX_SIZE) + if (size > MAX_SIZE || links > MAX_LINKS) { + Log.i("Message size=" + size + " links=" + links); return "" + context.getString(R.string.title_hint_too_complex) + ""; + } Whitelist whitelist = Whitelist.relaxed() .addTags("hr", "abbr")