Authored by chaogeng

Merge branch 'hotfix_0228' into gray

... ... @@ -16,6 +16,7 @@ import com.yohobuy.platform.model.grass.request.ArticleCommentModifyStatusReq;
import com.yohobuy.platform.model.grass.request.ArticleCommentQueryReq;
import com.yohobuy.platform.model.grass.response.ArticleCommentQueryRsp;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -83,8 +84,8 @@ public class GrassArticleCommentServiceImpl implements IGrassArticleCommentServi
com.setChildTotal(bo.getTotal());
}
UserInfoRspBO userInfoRspBO = userInfoRspBOMap.get(com.getUid());
if(null != userInfoRspBO){
com.setNickname(userInfoRspBO.getNickName());
if(null != userInfoRspBO && StringUtils.isNotBlank(userInfoRspBO.getNickName())){
com.setNickname(StringEscapeUtils.escapeHtml4(userInfoRspBO.getNickName()));
}
});
... ...
... ... @@ -24,6 +24,7 @@ import com.yohobuy.platform.model.common.PageResponseVO;
import com.yohobuy.platform.model.grass.request.GrassArticleReq;
import com.yohobuy.platform.model.grass.response.ArticleDetailRspBo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -484,10 +485,10 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
// rspBo.setTopicName(getArticleName(article.getTopicId()));
if(article.getAuthorType() ==2){
Author author = authorInfoMap.get(article.getAuthorUid());
rspBo.setNickName(author == null ? "" : author.getUsername());
rspBo.setNickName(StringEscapeUtils.escapeHtml4(author == null ? "" : author.getUsername()));
}else {
UserInfoRspBO userinfo = userInfoMap.get(article.getAuthorUid());
rspBo.setNickName(userinfo == null ? "" : userinfo.getNickName());
rspBo.setNickName(StringEscapeUtils.escapeHtml4(userinfo == null ? "" : userinfo.getNickName()));
}
rspBo.setCommentCount(Optional.ofNullable(commentCount.get(article.getId())).orElse(0));
rspBo.setFavorCount(article.getFavoriteCount());
... ...