Skip to content

Commit f124dfc

Browse files
committed
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.
1 parent c706290 commit f124dfc

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<classpathentry kind="lib" path="ext/commons-pool2-2.0.jar" sourcepath="ext/src/commons-pool2-2.0.jar" />
9696
<classpathentry kind="lib" path="ext/pf4j-0.9.0.jar" sourcepath="ext/src/pf4j-0.9.0.jar" />
9797
<classpathentry kind="lib" path="ext/tika-core-1.5.jar" sourcepath="ext/src/tika-core-1.5.jar" />
98-
<classpathentry kind="lib" path="ext/jsoup-1.7.3.jar" sourcepath="ext/src/jsoup-1.7.3.jar" />
98+
<classpathentry kind="lib" path="ext/jsoup-1.16.2.jar" sourcepath="ext/src/jsoup-1.16.2.jar" />
9999
<classpathentry kind="lib" path="ext/javax.activation-1.2.0.jar" sourcepath="ext/src/javax.activation-1.2.0.jar" />
100100
<classpathentry kind="lib" path="ext/junit-4.12.jar" sourcepath="ext/src/junit-4.12.jar" />
101101
<classpathentry kind="lib" path="ext/hamcrest-core-1.3.jar" sourcepath="ext/src/hamcrest-core-1.3.jar" />

build.moxie

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ dependencies:
191191
- compile 'redis.clients:jedis:2.6.2' :war
192192
- compile 'ro.fortsoft.pf4j:pf4j:0.9.0' :war
193193
- compile 'org.apache.tika:tika-core:1.5' :war
194-
- compile 'org.jsoup:jsoup:1.7.3' :war
194+
- compile 'org.jsoup:jsoup:1.16.2' :war
195195
- compile 'com.sun.activation:javax.activation:1.2.0' :war :manager :fedclient
196196
- test 'junit:junit:4.12'
197197
# Dependencies for Selenium web page testing

gitblit.iml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,13 +988,13 @@
988988
</library>
989989
</orderEntry>
990990
<orderEntry type="module-library">
991-
<library name="jsoup-1.7.3.jar">
991+
<library name="jsoup-1.16.2.jar">
992992
<CLASSES>
993-
<root url="jar://$MODULE_DIR$/ext/jsoup-1.7.3.jar!/" />
993+
<root url="jar://$MODULE_DIR$/ext/jsoup-1.16.2.jar!/" />
994994
</CLASSES>
995995
<JAVADOC />
996996
<SOURCES>
997-
<root url="jar://$MODULE_DIR$/ext/src/jsoup-1.7.3.jar!/" />
997+
<root url="jar://$MODULE_DIR$/ext/src/jsoup-1.16.2.jar!/" />
998998
</SOURCES>
999999
</library>
10001000
</orderEntry>

src/main/java/com/gitblit/utils/JSoupXssFilter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.jsoup.Jsoup;
1919
import org.jsoup.nodes.Document;
2020
import org.jsoup.safety.Cleaner;
21-
import org.jsoup.safety.Whitelist;
21+
import org.jsoup.safety.Safelist;
2222

2323
import com.google.inject.Inject;
2424
import com.google.inject.Singleton;
@@ -38,7 +38,7 @@ public class JSoupXssFilter implements XssFilter {
3838

3939
@Inject
4040
public JSoupXssFilter() {
41-
none = new Cleaner(Whitelist.none());
41+
none = new Cleaner(Safelist.none());
4242
relaxed = new Cleaner(getRelaxedWhiteList());
4343
}
4444

@@ -64,8 +64,8 @@ protected String clean(String input, Cleaner cleaner) {
6464
* https://github.com/github/markup/tree/master#html-sanitization
6565
* @return a loose HTML whitelist
6666
*/
67-
protected Whitelist getRelaxedWhiteList() {
68-
return new Whitelist()
67+
protected Safelist getRelaxedWhiteList() {
68+
return new Safelist()
6969
.addTags(
7070
"a", "b", "blockquote", "br", "caption", "cite", "code", "col",
7171
"colgroup", "dd", "del", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr",

0 commit comments

Comments
 (0)