Authored by chaogeng

Merge branch 'hotfix_0228' into gray

@@ -16,6 +16,7 @@ import com.yohobuy.platform.model.grass.request.ArticleCommentModifyStatusReq; @@ -16,6 +16,7 @@ import com.yohobuy.platform.model.grass.request.ArticleCommentModifyStatusReq;
16 import com.yohobuy.platform.model.grass.request.ArticleCommentQueryReq; 16 import com.yohobuy.platform.model.grass.request.ArticleCommentQueryReq;
17 import com.yohobuy.platform.model.grass.response.ArticleCommentQueryRsp; 17 import com.yohobuy.platform.model.grass.response.ArticleCommentQueryRsp;
18 import org.apache.commons.collections.CollectionUtils; 18 import org.apache.commons.collections.CollectionUtils;
  19 +import org.apache.commons.lang3.StringEscapeUtils;
19 import org.apache.commons.lang3.StringUtils; 20 import org.apache.commons.lang3.StringUtils;
20 import org.slf4j.Logger; 21 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory; 22 import org.slf4j.LoggerFactory;
@@ -83,8 +84,8 @@ public class GrassArticleCommentServiceImpl implements IGrassArticleCommentServi @@ -83,8 +84,8 @@ public class GrassArticleCommentServiceImpl implements IGrassArticleCommentServi
83 com.setChildTotal(bo.getTotal()); 84 com.setChildTotal(bo.getTotal());
84 } 85 }
85 UserInfoRspBO userInfoRspBO = userInfoRspBOMap.get(com.getUid()); 86 UserInfoRspBO userInfoRspBO = userInfoRspBOMap.get(com.getUid());
86 - if(null != userInfoRspBO){  
87 - com.setNickname(userInfoRspBO.getNickName()); 87 + if(null != userInfoRspBO && StringUtils.isNotBlank(userInfoRspBO.getNickName())){
  88 + com.setNickname(StringEscapeUtils.escapeHtml4(userInfoRspBO.getNickName()));
88 } 89 }
89 }); 90 });
90 91
@@ -24,6 +24,7 @@ import com.yohobuy.platform.model.common.PageResponseVO; @@ -24,6 +24,7 @@ import com.yohobuy.platform.model.common.PageResponseVO;
24 import com.yohobuy.platform.model.grass.request.GrassArticleReq; 24 import com.yohobuy.platform.model.grass.request.GrassArticleReq;
25 import com.yohobuy.platform.model.grass.response.ArticleDetailRspBo; 25 import com.yohobuy.platform.model.grass.response.ArticleDetailRspBo;
26 import org.apache.commons.collections.CollectionUtils; 26 import org.apache.commons.collections.CollectionUtils;
  27 +import org.apache.commons.lang3.StringEscapeUtils;
27 import org.apache.commons.lang3.StringUtils; 28 import org.apache.commons.lang3.StringUtils;
28 import org.slf4j.Logger; 29 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory; 30 import org.slf4j.LoggerFactory;
@@ -484,10 +485,10 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ @@ -484,10 +485,10 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
484 // rspBo.setTopicName(getArticleName(article.getTopicId())); 485 // rspBo.setTopicName(getArticleName(article.getTopicId()));
485 if(article.getAuthorType() ==2){ 486 if(article.getAuthorType() ==2){
486 Author author = authorInfoMap.get(article.getAuthorUid()); 487 Author author = authorInfoMap.get(article.getAuthorUid());
487 - rspBo.setNickName(author == null ? "" : author.getUsername()); 488 + rspBo.setNickName(StringEscapeUtils.escapeHtml4(author == null ? "" : author.getUsername()));
488 }else { 489 }else {
489 UserInfoRspBO userinfo = userInfoMap.get(article.getAuthorUid()); 490 UserInfoRspBO userinfo = userInfoMap.get(article.getAuthorUid());
490 - rspBo.setNickName(userinfo == null ? "" : userinfo.getNickName()); 491 + rspBo.setNickName(StringEscapeUtils.escapeHtml4(userinfo == null ? "" : userinfo.getNickName()));
491 } 492 }
492 rspBo.setCommentCount(Optional.ofNullable(commentCount.get(article.getId())).orElse(0)); 493 rspBo.setCommentCount(Optional.ofNullable(commentCount.get(article.getId())).orElse(0));
493 rspBo.setFavorCount(article.getFavoriteCount()); 494 rspBo.setFavorCount(article.getFavoriteCount());