Loading k9mail/src/main/java/com/fsck/k9/message/html/HtmlSanitizer.java +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ public class HtmlSanitizer { .addAttributes("area", "shape", "coords", "href", "alt") .addProtocols("area", "href", "http", "https") .addAttributes("img", "usemap") .addAttributes(":all", "class", "style", "id") .addAttributes(":all", "class", "style", "id", "dir") .addProtocols("img", "src", "http", "https", "cid", "data") .addProtocols("a", "href", "tel", "sip", "bitcoin", "ethereum", "rtsp"); Loading k9mail/src/test/java/com/fsck/k9/message/html/HtmlSanitizerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -264,4 +264,15 @@ public class HtmlSanitizerTest { "<a href=\"rtsp://example.com/media.mp4\">RTSP</a>" + "</body></html>", toCompactString(result)); } @Test public void shouldKeepDirAttribute() { String html = "<html><head></head><body>" + "<table><tbody><tr><td dir=\"rtl\"></td></tr></tbody></table>" + "</body></html>"; Document result = htmlSanitizer.sanitize(html); assertEquals(html, toCompactString(result)); } } Loading
k9mail/src/main/java/com/fsck/k9/message/html/HtmlSanitizer.java +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ public class HtmlSanitizer { .addAttributes("area", "shape", "coords", "href", "alt") .addProtocols("area", "href", "http", "https") .addAttributes("img", "usemap") .addAttributes(":all", "class", "style", "id") .addAttributes(":all", "class", "style", "id", "dir") .addProtocols("img", "src", "http", "https", "cid", "data") .addProtocols("a", "href", "tel", "sip", "bitcoin", "ethereum", "rtsp"); Loading
k9mail/src/test/java/com/fsck/k9/message/html/HtmlSanitizerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -264,4 +264,15 @@ public class HtmlSanitizerTest { "<a href=\"rtsp://example.com/media.mp4\">RTSP</a>" + "</body></html>", toCompactString(result)); } @Test public void shouldKeepDirAttribute() { String html = "<html><head></head><body>" + "<table><tbody><tr><td dir=\"rtl\"></td></tr></tbody></table>" + "</body></html>"; Document result = htmlSanitizer.sanitize(html); assertEquals(html, toCompactString(result)); } }