Prevent crash

pull/153/head
M66B 6 years ago
parent 11dec5c5bf
commit 5501a07e2d

@ -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();

Loading…
Cancel
Save