알림톡 대체문자시 XSS에 관련 특수기호 변경

This commit is contained in:
wyh 2024-10-17 14:21:40 +09:00
parent c34af54291
commit da3567b8c1
2 changed files with 18 additions and 3 deletions

View File

@ -203,9 +203,9 @@ $(document).ready(function(){
$('#smsTxtArea').val('');
// // 미리보기 텍스트를 가져와 줄바꿈 처리 후 대체문자 내용으로 입력
$('#smsTxtArea').val(
$('.template_text').html().trim().replace(/(<br>|<br\/>|<br \/>)/g, '\r\n')
);
var template_text = $('.template_text').html().trim();
template_text = XSSChange(template_text);
$('#smsTxtArea').val(template_text);
// //문자 내용 입력시 바이트수 계산하기

View File

@ -180,6 +180,21 @@ function XSSCheck(str, level) {
return str;
}
/**
* XSS 변경하기
*
*
*/
function XSSChange(str) {
str = str.replaceAll(/(<br>|<br\/>|<br \/>)/g, '\r\n');
str = str.replaceAll("&lt;", '<');
str = str.replaceAll("&gt;", '>');
str = str.replaceAll("&amp;", '&');
return str;
}
//숫자 천단위 콤마 찍어주기
function numberWithCommas(x) {