1:1문의 휴대폰번호 입력에 스크립트 입력할 수 있는 문제 수정 - I2sec 지민건님 제보

This commit is contained in:
chicpro
2014-01-23 12:46:21 +09:00
parent 80af2a0f8c
commit 2bdee0f848
3 changed files with 21 additions and 2 deletions

View File

@ -33,6 +33,9 @@ if (!empty($msg)) {
alert($msg); alert($msg);
} }
if($qa_hp)
$qa_hp = preg_replace('/[^0-9\-]/', '', strip_tags($qa_hp));
// 090710 // 090710
if (substr_count($qa_content, '&#') > 50) { if (substr_count($qa_content, '&#') > 50) {
alert('내용에 올바르지 않은 코드가 다수 포함되어 있습니다.'); alert('내용에 올바르지 않은 코드가 다수 포함되어 있습니다.');

View File

@ -63,7 +63,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<tr> <tr>
<th scope="row"><label for="qa_hp">휴대폰</label></th> <th scope="row"><label for="qa_hp">휴대폰</label></th>
<td> <td>
<input type="text" name="qa_hp" value="<?php echo $write['qa_hp']; ?>" id="qa_hp" <?php echo $req_hp; ?> class="<?php echo $req_email.' '; ?>frm_input" size="30"> <input type="text" name="qa_hp" value="<?php echo $write['qa_hp']; ?>" id="qa_hp" <?php echo $req_hp; ?> class="<?php echo $req_hp.' '; ?>frm_input" size="30">
<?php if($qaconfig['qa_use_sms']) { ?> <?php if($qaconfig['qa_use_sms']) { ?>
<input type="checkbox" name="qa_sms_recv" value="1" <?php if($write['qa_sms_recv']) echo 'checked="checked"'; ?>> 답변등록 SMS알림 수신 <input type="checkbox" name="qa_sms_recv" value="1" <?php if($write['qa_sms_recv']) echo 'checked="checked"'; ?>> 답변등록 SMS알림 수신
<?php } ?> <?php } ?>
@ -166,6 +166,14 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
return false; return false;
} }
<?php if ($is_hp) { ?>
var hp = f.qa_hp.value.replace(/[0-9\-]/g, "");
if(hp.length > 0) {
alert("휴대폰번호는 숫자, - 으로만 입력해 주십시오.");
return false;
}
<?php } ?>
document.getElementById("btn_submit").disabled = "disabled"; document.getElementById("btn_submit").disabled = "disabled";
return true; return true;

View File

@ -63,7 +63,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<tr> <tr>
<th scope="row"><label for="qa_hp">휴대폰</label></th> <th scope="row"><label for="qa_hp">휴대폰</label></th>
<td> <td>
<input type="text" name="qa_hp" value="<?php echo $write['qa_hp']; ?>" id="qa_hp" <?php echo $req_hp; ?> class="<?php echo $req_email.' '; ?>frm_input" size="30"> <input type="text" name="qa_hp" value="<?php echo $write['qa_hp']; ?>" id="qa_hp" <?php echo $req_hp; ?> class="<?php echo $req_hp.' '; ?>frm_input" size="30">
<?php if($qaconfig['qa_use_sms']) { ?> <?php if($qaconfig['qa_use_sms']) { ?>
<input type="checkbox" name="qa_sms_recv" value="1" <?php if($write['qa_sms_recv']) echo 'checked="checked"'; ?>> 답변등록 SMS알림 수신 <input type="checkbox" name="qa_sms_recv" value="1" <?php if($write['qa_sms_recv']) echo 'checked="checked"'; ?>> 답변등록 SMS알림 수신
<?php } ?> <?php } ?>
@ -166,6 +166,14 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
return false; return false;
} }
<?php if ($is_hp) { ?>
var hp = f.qa_hp.value.replace(/[0-9\-]/g, "");
if(hp.length > 0) {
alert("휴대폰번호는 숫자, - 으로만 입력해 주십시오.");
return false;
}
<?php } ?>
document.getElementById("btn_submit").disabled = "disabled"; document.getElementById("btn_submit").disabled = "disabled";
return true; return true;