From 053c9e73b032040f251e8be5e4e1d41853edc42e Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Sun, 13 Aug 2023 17:03:25 +0200 Subject: [PATCH] Fix parsing Community/post title with "&" characters --- app/src/main/java/eu/toldi/infinityforlemmy/post/ParsePost.java | 2 +- .../eu/toldi/infinityforlemmy/subreddit/ParseSubredditData.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/post/ParsePost.java b/app/src/main/java/eu/toldi/infinityforlemmy/post/ParsePost.java index 35c652bf..9245ea62 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/post/ParsePost.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/post/ParsePost.java @@ -174,7 +174,7 @@ public class ParsePost { } } - String title = post.getString("name"); + String title = post.getString("name").replace("&", "&"); String permalink = post.getString("ap_id"); int score = counts.getInt("score"); int upvotes = counts.getInt("upvotes"); diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/subreddit/ParseSubredditData.java b/app/src/main/java/eu/toldi/infinityforlemmy/subreddit/ParseSubredditData.java index acaac649..530ce175 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/subreddit/ParseSubredditData.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/subreddit/ParseSubredditData.java @@ -34,7 +34,7 @@ public class ParseSubredditData { return null; } - String title = community.getString(JSONUtils.TITLE_KEY); + String title = community.getString(JSONUtils.TITLE_KEY).replace("&", "&"); String bannerImageUrl = ""; if (!community.isNull("banner")) { bannerImageUrl = community.getString("banner");