diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp index 1d247ca4..7dc755bc 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp @@ -140,7 +140,10 @@ $(document).ready(function() { Accept: "application/json; charset=utf-8" }, success : resp => { - $P.cvlcptControl.setData([resp.cvlcptInfo]); + var cvlcptInfo = resp.cvlcptInfo; + cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); + $P.cvlcptControl.setData([cvlcptInfo]); + var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val()); $("#countStauts--${pageName}").val(cs); $P.parentRes.selectRow(crdnId); @@ -157,8 +160,9 @@ $(document).ready(function() { /************************************************************************** * 초기화 **************************************************************************/ - $P.cvlcptControl.setData([${cvlcptInfo}]); - + var cvlcptInfo = ${cvlcptInfo}; + cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); + $P.cvlcptControl.setData([cvlcptInfo]); var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val()); $("#countStauts--${pageName}").val(cs); }); diff --git a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js index ed4569e1..26bb7162 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js @@ -223,7 +223,27 @@ function getByte(str) { return size; }; - - - - +/** + * HTML 엔티티 문자코드를 특수문자로 치환한다. + * @return 치환된 문자열 + */ +function escapeHTMLEntity(str) { + if(str == undefined || str == null){ + return "" + } + + var regex = /&(amp|lt|gt|quot|#39);/g; + var chars = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + if(regex.test(str)) { + return str.replace(regex, (matched) => chars[matched] || matched); + } else { + return str; + } +}