Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
쇼핑몰 환경설정 스킨 파일 체크 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Mar 19, 2019
1 parent bf778a3 commit 76b31e7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions adm/shop_admin/configformupdate.php
Expand Up @@ -33,8 +33,8 @@
alert('NHN KCP SITE KEY를 입력해 주십시오.');
}

$de_shop_skin = isset($_POST['de_shop_skin']) ? preg_replace('/(\.\.\/|\.\/|\.\.\\\|\.\\\)/', '', $_POST['de_shop_skin']) : 'basic';
$de_shop_mobile_skin = isset($_POST['de_shop_mobile_skin']) ? preg_replace('/(\.\.\/|\.\/|\.\.\\\|\.\\\)/', '', $_POST['de_shop_mobile_skin']) : 'basic';
$de_shop_skin = isset($_POST['de_shop_skin']) ? preg_replace('#\.+(\/|\\\)#', '', $_POST['de_shop_skin']) : 'basic';
$de_shop_mobile_skin = isset($_POST['de_shop_mobile_skin']) ? preg_replace('#\.+(\/|\\\)#', '', $_POST['de_shop_mobile_skin']) : 'basic';

$skins = get_skin_dir('shop');

Expand Down Expand Up @@ -64,11 +64,7 @@
$check_skin_keys = array('de_type1_list_skin', 'de_type2_list_skin', 'de_type3_list_skin', 'de_type4_list_skin', 'de_type5_list_skin', 'de_mobile_type1_list_skin', 'de_mobile_type2_list_skin', 'de_mobile_type3_list_skin', 'de_mobile_type4_list_skin', 'de_mobile_type5_list_skin', 'de_rel_list_skin', 'de_mobile_rel_list_skin', 'de_search_list_skin', 'de_mobile_search_list_skin', 'de_listtype_list_skin', 'de_mobile_listtype_list_skin');

foreach($check_skin_keys as $key){
$skin_file = isset($_POST[$key]) ? $_POST[$key] : '';

if( $skin_file && ! preg_match('/^.*\.(php|htm|html)$/i', $skin_file) ){
alert('스킨 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
$$key = $_POST[$key] = isset($_POST[$key]) ? preg_replace('#\.+(\/|\\\)#', '', $_POST[$key]) : '';
}

//
Expand Down

0 comments on commit 76b31e7

Please sign in to comment.