정리해서 다시 질문요(급) 정보
정리해서 다시 질문요(급)본문
읽어 주셔서 감사합니다.
글쓰기 내용중 제목이나 내용에 주민번호, 카드번호 와 같은
신상정보 입력을 금지하려고 아래와 같이 했는데 반응이 없어서..
머가 틀렸을까 좀 고수님들의 부탁드립니다.
function fwrite_check(f)
{
var s = "";
if (s = word_filter_check(f.wr_subject.value)) {
alert("제목에 금지단어('"+s+"')가 포함되어있습니다");
return;
}
if (s = word_filter_check(f.wr_content.value)) {
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
return;
}
if (char_min > 0 || char_max > 0)
{
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt)
{
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
return;
} else if (char_max > 0 && char_max < cnt)
{
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return;
}
}
<-- 여기서 부터 -->
tmp_content = f.wr_content.value;
tmp_content = tmp_content.replace(/\s/g,'');
tmp_content = tmp_content.replace(/ /g,'');
tmp_content = tmp_content.replace(/-/g,'');
tmp_content = tmp_content.replace(/\\/g,'');
tmp_content = tmp_content.replace(/\//g,'');
tmp_title = f.wr_Subject.value;
tmp_title = tmp_title.replace(/\s/g,'');
tmp_title = tmp_title.replace(/ /g,'');
tmp_title = tmp_title.replace(/-/g,'');
tmp_title = tmp_title.replace(/\\/g,'');
tmp_title = tmp_title.replace(/\//g,'');
if(tmp_title.search(/\d{6}\-\d{7}/) != -1 || tmp_title.search(/\d{13}/) != -1 || tmp_title.search(/\d{4}\-\d{4}\-\d{4}\-\d{4}/) != -1 || tmp_title.search(/\d{16}/) != -1)
{
alert('글 제목에 개인정보 노출 위험이 있습니다.\n\n개인정보(주민등록번호,신용카드번호)는 등록이 불가합니다.');
return;
}
if(tmp_content.search(/\d{6}\-\d{7}/) != -1 || tmp_content.search(/\d{13}/) != -1 || tmp_content.search(/\d{4}\-\d{4}\-\d{4}\-\d{4}/) != -1 || tmp_content.search(/\d{16}/) != -1)
{
alert('글 내용에 개인정보 노출 위험이 있습니다.\n\n개인정보(주민등록번호,신용카드번호)는 등록이 불가합니다.');
return;
}
<-- 요기 까지 -->
글쓰기 내용중 제목이나 내용에 주민번호, 카드번호 와 같은
신상정보 입력을 금지하려고 아래와 같이 했는데 반응이 없어서..
머가 틀렸을까 좀 고수님들의 부탁드립니다.
function fwrite_check(f)
{
var s = "";
if (s = word_filter_check(f.wr_subject.value)) {
alert("제목에 금지단어('"+s+"')가 포함되어있습니다");
return;
}
if (s = word_filter_check(f.wr_content.value)) {
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
return;
}
if (char_min > 0 || char_max > 0)
{
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt)
{
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
return;
} else if (char_max > 0 && char_max < cnt)
{
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return;
}
}
<-- 여기서 부터 -->
tmp_content = f.wr_content.value;
tmp_content = tmp_content.replace(/\s/g,'');
tmp_content = tmp_content.replace(/ /g,'');
tmp_content = tmp_content.replace(/-/g,'');
tmp_content = tmp_content.replace(/\\/g,'');
tmp_content = tmp_content.replace(/\//g,'');
tmp_title = f.wr_Subject.value;
tmp_title = tmp_title.replace(/\s/g,'');
tmp_title = tmp_title.replace(/ /g,'');
tmp_title = tmp_title.replace(/-/g,'');
tmp_title = tmp_title.replace(/\\/g,'');
tmp_title = tmp_title.replace(/\//g,'');
if(tmp_title.search(/\d{6}\-\d{7}/) != -1 || tmp_title.search(/\d{13}/) != -1 || tmp_title.search(/\d{4}\-\d{4}\-\d{4}\-\d{4}/) != -1 || tmp_title.search(/\d{16}/) != -1)
{
alert('글 제목에 개인정보 노출 위험이 있습니다.\n\n개인정보(주민등록번호,신용카드번호)는 등록이 불가합니다.');
return;
}
if(tmp_content.search(/\d{6}\-\d{7}/) != -1 || tmp_content.search(/\d{13}/) != -1 || tmp_content.search(/\d{4}\-\d{4}\-\d{4}\-\d{4}/) != -1 || tmp_content.search(/\d{16}/) != -1)
{
alert('글 내용에 개인정보 노출 위험이 있습니다.\n\n개인정보(주민등록번호,신용카드번호)는 등록이 불가합니다.');
return;
}
<-- 요기 까지 -->
댓글 전체
한번물어보세요
위 적용했습니다..해보니까 돼네