Q&A 제목 특수문자처리
This commit is contained in:
parent
eb5a63c33d
commit
5338723ce2
@ -108,6 +108,8 @@ public class HTMLTagFilterRequestWrapper extends HttpServletRequestWrapper {
|
||||
}
|
||||
|
||||
private String getSafeParamData(String value) {
|
||||
|
||||
/*
|
||||
StringBuffer strBuff = new StringBuffer();
|
||||
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
@ -143,6 +145,7 @@ public class HTMLTagFilterRequestWrapper extends HttpServletRequestWrapper {
|
||||
}
|
||||
|
||||
value = strBuff.toString();
|
||||
*/
|
||||
|
||||
// SQL INJECTION 취약점 보완
|
||||
value = value.replaceAll("\\s+[o|O][r|R]\\s+", " o-r ");
|
||||
|
||||
@ -100,6 +100,9 @@ public class ArticleVO extends PagingVO {
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
public String getUnescapeTitle() {
|
||||
return StringEscapeUtils.unescapeHtml(title);
|
||||
}
|
||||
public void setTitle(String title) {
|
||||
this.title = StringUtil.getSafeParamData(title);
|
||||
}
|
||||
|
||||
@ -314,7 +314,7 @@ function fn_downloadFile(attachFileId, fileSn) {
|
||||
<li class="wt-title fl">
|
||||
<div class="w-tit">제목</div>
|
||||
<div class="w-form">
|
||||
<input type="text" name="title" id="title" title="제목" value="${searchArticle.title}" size="100" maxlength="200" class="grid-1" placeholder="제목을 입력하세요." required />
|
||||
<input type="text" name="title" id="title" title="제목" value="${searchArticle.unescapeTitle}" size="100" maxlength="200" class="grid-1" placeholder="제목을 입력하세요." required />
|
||||
</div>
|
||||
</li>
|
||||
<li class="wt-secret fl check">
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
var li = $('<tr class="tableTrData" />');
|
||||
li.append($('<td />').attr('class', 't-num').html(obj.rno));
|
||||
li.append($('<td />').attr('class', 't-tit').html("<a href=\"javascript:void(0)\" onclick=\"fn_viewDetail('" + obj.articleId + "','" + obj.secretYn + "','" + obj.myQnaYn + "')\">" +
|
||||
obj.title +
|
||||
obj.unescapeTitle +
|
||||
(obj.secretYn == "Y" ? '<img src="/images/icon/icon-password.png" alt="자물쇠 아이콘"> ' : '') +
|
||||
"</a>"));
|
||||
li.append($('<td />').attr('class', 't-writer').html(obj.regNmSec));
|
||||
|
||||
@ -115,7 +115,7 @@ function fn_downloadFile(attachFileId, fileSn) {
|
||||
<span class="type">
|
||||
<c:if test='${article.answerYn == "Y"}'><span>답변완료</span></c:if>
|
||||
</span>
|
||||
${article.title}
|
||||
${article.unescapeTitle}
|
||||
<span>
|
||||
<c:if test='${article.secretYn == "Y"}'>
|
||||
<img src="/images/icon/icon-secret.png" alt="자물쇠 아이콘">
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter>
|
||||
<filter-name>HTMLTagFilter</filter-name>
|
||||
<filter-class>egovframework.com.cmm.filter.HTMLTagFilter</filter-class>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user