1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 01:36:55 +00:00

Prevent crash

This commit is contained in:
M66B 2019-03-11 06:49:43 +00:00
parent 11dec5c5bf
commit 5501a07e2d

View file

@ -87,9 +87,11 @@ public class HtmlHelper {
// Remove Javascript
for (Element e : document.select("*"))
for (Attribute a : e.attributes())
if (a.getValue().trim().toLowerCase().startsWith("javascript:"))
for (Attribute a : e.attributes()) {
String v = a.getValue();
if (v != null && v.trim().toLowerCase().startsWith("javascript:"))
e.removeAttr(a.getKey());
}
// Remove scripts
document.select("script").remove();