영카트 sql 인젝션 취약점 17-292 수정

This commit is contained in:
thisgun
2017-06-13 19:31:34 +09:00
parent 8adf274e84
commit 023f27c320

View File

@ -14,20 +14,21 @@ if ($is_member && $count) {
for ($i=0; $i<$count; $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$k = (int) $_POST['chk'][$i];
$ad_id = (int) $_POST['ad_id'][$k];
$ad_subject = clean_xss_tags($_POST['ad_subject'][$k]);
$sql = " update {$g5['g5_shop_order_address_table']}
set ad_subject = '$ad_subject' ";
if($_POST['ad_default'] && $_POST['ad_id'][$k] == $_POST['ad_default']) {
if(!empty($_POST['ad_default']) && $ad_id == $_POST['ad_default']) {
sql_query(" update {$g5['g5_shop_order_address_table']} set ad_default = '0' where mb_id = '{$member['mb_id']}' ");
$sql .= ", ad_default = '1' ";
}
$sql .= " where ad_id = '{$_POST['ad_id'][$k]}'
$sql .= " where ad_id = '".$ad_id."'
and mb_id = '{$member['mb_id']}' ";
sql_query($sql);