From: Florian Zschocke Date: Tue, 31 Oct 2023 17:27:35 +0000 (+0100) Subject: dep: Update JSoup to 1.16.2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f124dfca7f8ec97b1f28cb5d258d8ee5d1da9b30;p=gitblit.git dep: Update JSoup to 1.16.2 Update JSoup to version 1.16.2. This requires renaming `Whitelist` to `Safelist`, because the class name was changed in version 1.15.1 in a breaking change. --- diff --git a/.classpath b/.classpath index 094e1508..6dd5eace 100644 --- a/.classpath +++ b/.classpath @@ -95,7 +95,7 @@ - + diff --git a/build.moxie b/build.moxie index e5da1b2b..e410855b 100644 --- a/build.moxie +++ b/build.moxie @@ -191,7 +191,7 @@ dependencies: - compile 'redis.clients:jedis:2.6.2' :war - compile 'ro.fortsoft.pf4j:pf4j:0.9.0' :war - compile 'org.apache.tika:tika-core:1.5' :war -- compile 'org.jsoup:jsoup:1.7.3' :war +- compile 'org.jsoup:jsoup:1.16.2' :war - compile 'com.sun.activation:javax.activation:1.2.0' :war :manager :fedclient - test 'junit:junit:4.12' # Dependencies for Selenium web page testing diff --git a/gitblit.iml b/gitblit.iml index 15471f7e..85756ae8 100644 --- a/gitblit.iml +++ b/gitblit.iml @@ -988,13 +988,13 @@ - + - + - + diff --git a/src/main/java/com/gitblit/utils/JSoupXssFilter.java b/src/main/java/com/gitblit/utils/JSoupXssFilter.java index aec22411..f2702813 100644 --- a/src/main/java/com/gitblit/utils/JSoupXssFilter.java +++ b/src/main/java/com/gitblit/utils/JSoupXssFilter.java @@ -18,7 +18,7 @@ package com.gitblit.utils; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.safety.Cleaner; -import org.jsoup.safety.Whitelist; +import org.jsoup.safety.Safelist; import com.google.inject.Inject; import com.google.inject.Singleton; @@ -38,7 +38,7 @@ public class JSoupXssFilter implements XssFilter { @Inject public JSoupXssFilter() { - none = new Cleaner(Whitelist.none()); + none = new Cleaner(Safelist.none()); relaxed = new Cleaner(getRelaxedWhiteList()); } @@ -64,8 +64,8 @@ public class JSoupXssFilter implements XssFilter { * https://github.com/github/markup/tree/master#html-sanitization * @return a loose HTML whitelist */ - protected Whitelist getRelaxedWhiteList() { - return new Whitelist() + protected Safelist getRelaxedWhiteList() { + return new Safelist() .addTags( "a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "del", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr",