From 0dfcd14064a1eaf55acf057e4cc65ee2e4f5ef0a Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 19 Mar 2022 13:19:20 +0100 Subject: Update dependencies. Change-Id: I94904259a5d8dd4b8011ae578632fb9cd646c93e --- pom.xml | 42 +++++++++++----------- .../eu/mulk/mulkcms2/benki/posts/PostText.java | 5 +++ .../eu/mulk/mulkcms2/benki/wiki/WikiResource.java | 4 +-- .../common/markdown/MarkdownConverter.java | 4 +-- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index b54e55b..cd94789 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,8 @@ - + 4.0.0 @@ -10,8 +12,8 @@ true - 11 - 11 + 17 + 17 UTF-8 UTF-8 @@ -20,28 +22,28 @@ 3.0.0 3.8.1 - 3.0.0-M3 + 3.0.0 4.2 - 2.0.2.Final + 2.7.5.Final 3.2.0 - 2.11.0 + 2.19.0 quarkus-universe-bom io.quarkus 0.2.0 3.0.2 - 0.62.2 - 1.10.0 - 5.4.27.Final - 2.12.0 + 0.64.0 + 1.15.0 + 5.6.5.Final + 2.14.0 1.6.1 - 5.8.0 - 1.13.1 - 1.5.20 - 4.3.5 - 42.2.22 - 1.15.0 + 5.10.0 + 1.14.3 + 1.6.10 + 4.8.0 + 42.3.3 + 1.18.0 @@ -58,7 +60,7 @@ com.vladmihalcea - hibernate-types-52 + hibernate-types-55 ${hibernate-types.version} @@ -214,7 +216,7 @@ com.vladmihalcea - hibernate-types-52 + hibernate-types-55 @@ -393,7 +395,7 @@ generate-resources - + diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java index 25955bd..11ac98a 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java @@ -1,5 +1,6 @@ package eu.mulk.mulkcms2.benki.posts; +import com.vladmihalcea.hibernate.type.search.PostgreSQLTSVectorType; import io.quarkus.hibernate.orm.panache.PanacheEntityBase; import javax.annotation.CheckForNull; import javax.json.bind.annotation.JsonbTransient; @@ -15,11 +16,14 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.Generated; import org.hibernate.annotations.GenerationTime; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; @Entity @Table(name = "post_texts", schema = "benki") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @IdClass(PostTextPK.class) +@TypeDef(name = "tsvector", typeClass = PostgreSQLTSVectorType.class) public abstract class PostText> extends PanacheEntityBase { private static final int DESCRIPTION_CACHE_VERSION = 1; @@ -42,6 +46,7 @@ public abstract class PostText> extends PanacheEntity @Column(name = "search_terms") @Generated(GenerationTime.ALWAYS) + @Type(type = "tsvector") public String searchTerms; @ManyToOne(fetch = FetchType.LAZY, targetEntity = Post.class) diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java index 1622334..edf9c72 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java @@ -32,7 +32,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; import org.jsoup.Jsoup; -import org.jsoup.safety.Whitelist; +import org.jsoup.safety.Safelist; @Path("/wiki") public class WikiResource { @@ -94,7 +94,7 @@ public class WikiResource { if (title != null) { // Remove markup. Reject whitespace. - title = Jsoup.clean(title, Whitelist.none()); + title = Jsoup.clean(title, Safelist.none()); if (!title.matches("\\w+")) { throw new BadRequestException("title does not match \"\\w+\""); } diff --git a/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java b/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java index cd75afe..0200514 100644 --- a/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java +++ b/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java @@ -12,7 +12,7 @@ import com.vladsch.flexmark.util.data.MutableDataSet; import java.util.Arrays; import javax.enterprise.context.ApplicationScoped; import org.jsoup.Jsoup; -import org.jsoup.safety.Whitelist; +import org.jsoup.safety.Safelist; @ApplicationScoped public class MarkdownConverter { @@ -44,6 +44,6 @@ public class MarkdownConverter { public String htmlify(String markdown) { var parsedDocument = parser.parse(markdown); var unsanitizedHtml = renderer.render(parsedDocument); - return Jsoup.clean(unsanitizedHtml, Whitelist.relaxed()); + return Jsoup.clean(unsanitizedHtml, Safelist.relaxed()); } } -- cgit v1.2.3