PHP8에 맞지 않는 함수와 코드 추가 수정

This commit is contained in:
thisgun
2021-01-11 12:19:29 +09:00
parent 47483cd913
commit ba8b4b8c5b
2 changed files with 6 additions and 4 deletions

View File

@ -7,7 +7,7 @@ if (preg_match("/[^\w\-]/", $it_id)) { // \w : 0-9 A-Z a-z _
}
$row = get_shop_item($it_id, true);
if ($row['it_name']) {
if (isset($row['it_name']) && $row['it_name']) {
$it_name = addslashes($row['it_name']);
die("{\"error\":\"이미 등록된 상품코드 입니다.\\n\\n상품명 : {$it_name}\"}");
}

View File

@ -662,9 +662,11 @@ function it_img_upload($srcfile, $filename, $dir)
$filename = preg_replace( $pattern, "", $filename);
$filename = preg_replace_callback(
"/[가-힣]+/",
create_function('$matches', 'return base64_encode($matches[0]);'),
$filename);
"/[가-힣]+/",
function($matches) {
return isset($matches[0]) ? base64_encode($matches[0]) : '';
},
$filename);
$filename = preg_replace( $pattern, "", $filename);
$prepend = '';