From 86bea9e0016b2890db8ba83049dd4e89653a0a5e Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Fri, 16 Mar 2012 17:29:39 -0400 Subject: [PATCH] Ensure that the welcome message is interpreted as UTF-8 (issue 74) --- src/com/gitblit/utils/SyndicationUtils.java | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/com/gitblit/utils/SyndicationUtils.java b/src/com/gitblit/utils/SyndicationUtils.java index 6ba8d73..061d12a 100644 --- a/src/com/gitblit/utils/SyndicationUtils.java +++ b/src/com/gitblit/utils/SyndicationUtils.java @@ -97,8 +97,14 @@ } SyndContent content = new SyndContentImpl(); - content.setType(entryModel.contentType); - content.setValue(entryModel.content); + if (StringUtils.isEmpty(entryModel.contentType) + || entryModel.contentType.equalsIgnoreCase("text/plain")) { + content.setType("text/html"); + content.setValue(StringUtils.breakLinesForHtml(entryModel.content)); + } else { + content.setType(entryModel.contentType); + content.setValue(entryModel.content); + } entry.setDescription(content); entries.add(entry); @@ -167,9 +173,9 @@ * @return a list of SyndicationModel entries * @throws {@link IOException} */ - public static List<FeedEntryModel> readSearchFeed(String url, String repository, - String branch, String fragment, Constants.SearchType searchType, int numberOfEntries, - int page, String username, char[] password) throws IOException { + public static List<FeedEntryModel> readSearchFeed(String url, String repository, String branch, + String fragment, Constants.SearchType searchType, int numberOfEntries, int page, + String username, char[] password) throws IOException { // determine parameters List<String> parameters = new ArrayList<String>(); parameters.add("s=" + StringUtils.encodeURL(fragment)); -- Gitblit v1.9.1