Commit 84fce193 authored by Liang Ding's avatar Liang Ding

🐛 Fix #12448

parent bda144a3
...@@ -27,7 +27,7 @@ import java.util.Set; ...@@ -27,7 +27,7 @@ import java.util.Set;
* Item. * Item.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.0, Mar 10, 2018 * @version 1.1.2.0, May 18, 2018
* @since 0.3.1 * @since 0.3.1
*/ */
public final class Item { public final class Item {
...@@ -269,7 +269,7 @@ public final class Item { ...@@ -269,7 +269,7 @@ public final class Item {
stringBuilder.append(END_GUID_ELEMENT); stringBuilder.append(END_GUID_ELEMENT);
for (final Category category : categories) { for (final Category category : categories) {
stringBuilder.append(category.toString()); stringBuilder.append(StringEscapeUtils.escapeXml(category.toString()));
} }
stringBuilder.append(START_PUB_DATE_ELEMENT); stringBuilder.append(START_PUB_DATE_ELEMENT);
......
...@@ -45,6 +45,7 @@ import org.b3log.solo.repository.TagRepository; ...@@ -45,6 +45,7 @@ import org.b3log.solo.repository.TagRepository;
import org.b3log.solo.service.ArticleQueryService; import org.b3log.solo.service.ArticleQueryService;
import org.b3log.solo.service.PreferenceQueryService; import org.b3log.solo.service.PreferenceQueryService;
import org.b3log.solo.service.UserQueryService; import org.b3log.solo.service.UserQueryService;
import org.b3log.solo.util.Emotions;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
...@@ -61,7 +62,7 @@ import java.util.List; ...@@ -61,7 +62,7 @@ import java.util.List;
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="https://github.com/feroozkhanchintu">feroozkhanchintu</a> * @author <a href="https://github.com/feroozkhanchintu">feroozkhanchintu</a>
* @author <a href="https://github.com/nanolikeyou">nanolikeyou</a> * @author <a href="https://github.com/nanolikeyou">nanolikeyou</a>
* @version 1.1.0.8, Oct 21, 2017 * @version 1.1.1.0, May 18, 2018
* @since 0.3.1 * @since 0.3.1
*/ */
@RequestProcessor @RequestProcessor
...@@ -405,11 +406,13 @@ public class FeedProcessor { ...@@ -405,11 +406,13 @@ public class FeedProcessor {
throws org.json.JSONException, org.b3log.latke.service.ServiceException { throws org.json.JSONException, org.b3log.latke.service.ServiceException {
final JSONObject article = articles.getJSONObject(i); final JSONObject article = articles.getJSONObject(i);
final Item ret = new Item(); final Item ret = new Item();
final String title = article.getString(Article.ARTICLE_TITLE); String title = article.getString(Article.ARTICLE_TITLE);
title = Emotions.toAliases(title);
ret.setTitle(title); ret.setTitle(title);
final String description = isFullContent String description = isFullContent
? article.getString(Article.ARTICLE_CONTENT) ? article.getString(Article.ARTICLE_CONTENT)
: article.optString(Article.ARTICLE_ABSTRACT); : article.optString(Article.ARTICLE_ABSTRACT);
description = Emotions.toAliases(description);
ret.setDescription(description); ret.setDescription(description);
final Date pubDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE); final Date pubDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE);
ret.setPubDate(pubDate); ret.setPubDate(pubDate);
......
...@@ -119,7 +119,6 @@ public class SitemapProcessor { ...@@ -119,7 +119,6 @@ public class SitemapProcessor {
String content = sitemap.toString(); String content = sitemap.toString();
content = XMLs.format(content); content = XMLs.format(content);
LOGGER.log(Level.INFO, "Generated sitemap"); LOGGER.log(Level.INFO, "Generated sitemap");
LOGGER.info(content);
renderer.setContent(content); renderer.setContent(content);
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Get blog article feed error", e); LOGGER.log(Level.ERROR, "Get blog article feed error", e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment