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