From a502d96a860456ec5e8c96761db70f7cabb74751 Mon Sep 17 00:00:00 2001 From: Paul Martin <paul@paulsputer.com> Date: Sat, 30 Apr 2016 04:19:14 -0400 Subject: [PATCH] Merge pull request #1073 from gitblit/1062-DocEditorUpdates --- src/main/java/com/gitblit/servlet/SyndicationServlet.java | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gitblit/servlet/SyndicationServlet.java b/src/main/java/com/gitblit/servlet/SyndicationServlet.java index 29db54d..39dbf2e 100644 --- a/src/main/java/com/gitblit/servlet/SyndicationServlet.java +++ b/src/main/java/com/gitblit/servlet/SyndicationServlet.java @@ -22,8 +22,6 @@ import java.util.List; import java.util.Map; -import com.google.inject.Inject; -import com.google.inject.Singleton; import javax.servlet.http.HttpServlet; import org.eclipse.jgit.lib.ObjectId; @@ -48,6 +46,8 @@ import com.gitblit.utils.JGitUtils; import com.gitblit.utils.StringUtils; import com.gitblit.utils.SyndicationUtils; +import com.google.inject.Inject; +import com.google.inject.Singleton; /** * SyndicationServlet generates RSS 2.0 feeds and feed links. @@ -154,7 +154,7 @@ String servletUrl = request.getContextPath() + request.getServletPath(); String url = request.getRequestURI().substring(servletUrl.length()); - if (url.charAt(0) == '/' && url.length() > 1) { + if (url.length() > 1 && url.charAt(0) == '/') { url = url.substring(1); } String repositoryName = url; @@ -199,7 +199,7 @@ response.setContentType("application/rss+xml; charset=UTF-8"); boolean isProjectFeed = false; - String feedName = null; + String feedName = "Gitblit"; String feedTitle = null; String feedDescription = null; @@ -243,7 +243,7 @@ RepositoryModel model = repositoryManager.getRepositoryModel(name); if (repository == null) { - if (model.isCollectingGarbage) { + if (model != null && model.isCollectingGarbage) { logger.warn(MessageFormat.format("Temporarily excluding {0} from feed, busy collecting garbage", name)); } continue; @@ -368,7 +368,7 @@ if (mountParameters) { // mounted url feedLink = MessageFormat.format("{0}/summary/{1}", gitblitUrl, - StringUtils.encodeURL(feedName)); + StringUtils.encodeURL(feedName.replace('/', fsc))); } else { // parameterized url feedLink = MessageFormat.format("{0}/summary/?r={1}", gitblitUrl, -- Gitblit v1.9.1