[KVE-2022-0184] XSS 및 SQLInjection 취약점 해결을 위해 사용하지 않고 있던 "코드 중복검사" 기능 제거

This commit is contained in:
kagla
2022-04-07 15:43:33 +09:00
parent 38e732e71e
commit 9ac9e01a51
4 changed files with 0 additions and 66 deletions

View File

@ -157,7 +157,6 @@ else {
<form name="fcategoryform" action="./categoryformupdate.php" onsubmit="return fcategoryformcheck(this);" method="post" enctype="multipart/form-data">
<input type="hidden" name="codedup" value="<?php echo $default['de_code_dup_use']; ?>">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
@ -184,7 +183,6 @@ else {
<?php if ($w == "") { ?>
<?php echo help("자동으로 보여지는 분류코드를 사용하시길 권해드리지만 직접 입력한 값으로도 사용할 수 있습니다.\n분류코드는 나중에 수정이 되지 않으므로 신중하게 결정하여 사용하십시오.\n\n분류코드는 2자리씩 10자리를 사용하여 5단계를 표현할 수 있습니다.\n0~z까지 입력이 가능하며 한 분류당 최대 1296가지를 표현할 수 있습니다.\n그러므로 총 3656158440062976가지의 분류를 사용할 수 있습니다."); ?>
<input type="text" name="ca_id" value="<?php echo $subid; ?>" id="ca_id" required class="required frm_input" size="<?php echo $sublen; ?>" maxlength="<?php echo $sublen; ?>">
<!-- <?php if ($default['de_code_dup_use']) { ?><a href="javascript:;" onclick="codedupcheck(document.getElementById('ca_id').value)">코드 중복검사</a><?php } ?> -->
<?php } else { ?>
<input type="hidden" name="ca_id" value="<?php echo $ca['ca_id']; ?>">
<span class="frm_ca_id"><?php echo $ca['ca_id']; ?></span>

View File

@ -1,24 +0,0 @@
<?php
include_once('./_common.php');
$it_id = isset($it_id) ? clean_xss_tags(trim($it_id)) : '';
$ca_id = isset($ca_id) ? clean_xss_tags(trim($ca_id)) : '';
$code = '';
$name = '';
if ($it_id)
{
$row = get_shop_item($it_id, true);
$code = $it_id;
$name = $row['it_name'];
}
else if ($ca_id)
{
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
$row = sql_fetch($sql);
$code = $ca_id;
$name = $row['ca_name'];
}
echo '{ "code": "' . $code . '", "name": "' . $name . '" }';

View File

@ -1398,13 +1398,6 @@ if(!$default['de_kakaopay_cancelpwd']){
<?php echo get_member_level_select('de_level_sell', 1, 10, $default['de_level_sell']); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="de_code_dup_use">코드 중복검사</label></th>
<td>
<?php echo help("분류, 상품 등을 추가할 때 자동으로 코드 중복검사를 하려면 체크하십시오."); ?>
<input type="checkbox" name="de_code_dup_use" value="1" id="de_code_dup_use"<?php echo $default['de_code_dup_use']?' checked':''; ?>> 사용
</td>
</tr>
<tr>
<th scope="row"><label for="de_cart_keep_term">장바구니 보관기간</label></th>
<td>

View File

@ -210,7 +210,6 @@ if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)
<form name="fitemform" action="./itemformupdate.php" method="post" enctype="MULTIPART/FORM-DATA" autocomplete="off" onsubmit="return fitemformcheck(this)">
<input type="hidden" name="codedup" value="<?php echo $default['de_code_dup_use']; ?>">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
@ -333,11 +332,8 @@ if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)
<th scope="row">상품코드</th>
<td colspan="2">
<?php if ($w == '') { // 추가 ?>
<!-- 최근에 입력한 코드(자동 생성시)가 목록의 상단에 출력되게 하려면 아래의 코드로 대체하십시오. -->
<!-- <input type=text class=required name=it_id value="<?php echo 10000000000-time()?>" size=12 maxlength=10 required> <a href='javascript:;' onclick="codedupcheck(document.all.it_id.value)"><img src='./img/btn_code.gif' border=0 align=absmiddle></a> -->
<?php echo help("상품의 코드는 10자리 숫자로 자동생성합니다. <b>직접 상품코드를 입력할 수도 있습니다.</b>\n상품코드는 영문자, 숫자, - 만 입력 가능합니다."); ?>
<input type="text" name="it_id" value="<?php echo time(); ?>" id="it_id" required class="frm_input required" size="20" maxlength="20">
<!-- <?php if ($default['de_code_dup_use']) { ?><button type="button" class="btn_frmline" onclick="codedupcheck(document.all.it_id.value)">중복검사</a><?php } ?> -->
<?php } else { ?>
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
<span class="frm_ca_id"><?php echo $it['it_id']; ?></span>
@ -1782,35 +1778,6 @@ $(function() {
});
<?php } ?>
function codedupcheck(id)
{
if (!id) {
alert('상품코드를 입력하십시오.');
f.it_id.focus();
return;
}
var it_id = id.replace(/[A-Za-z0-9\-_]/g, "");
if(it_id.length > 0) {
alert("상품코드는 영문자, 숫자, -, _ 만 사용할 수 있습니다.");
return false;
}
$.post(
"./codedupcheck.php",
{ it_id: id },
function(data) {
if(data.name) {
alert("코드 '"+data.code+"' 는 '".data.name+"' (으)로 이미 등록되어 있으므로\n\n사용하실 수 없습니다.");
return false;
} else {
alert("'"+data.code+"' 은(는) 등록된 코드가 없으므로 사용하실 수 있습니다.");
document.fitemform.codedup.value = '';
}
}, "json"
);
}
function fitemformcheck(f)
{
if (!f.ca_id.value) {