php8.0 버전 호환 코드 적용 및 PHP 끝 태그 삭제 일괄적용

This commit is contained in:
thisgun
2021-01-04 15:33:29 +09:00
parent 10d377de7d
commit 582d1a01f4
852 changed files with 120617 additions and 6307 deletions

View File

@ -7,11 +7,14 @@ include_once(G5_LIB_PATH.'/thumbnail.lib.php');
if ($w == 'u')
check_demo();
auth_check($auth[$sub_menu], 'w');
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$mb_id = trim($_POST['mb_id']);
$mb_id = isset($_POST['mb_id']) ? trim($_POST['mb_id']) : '';
$mb_certify_case = isset($_POST['mb_certify_case']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify_case']) : '';
$mb_certify = isset($_POST['mb_certify']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify']) : '';
$mb_zip = isset($_POST['mb_zip']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_zip']) : '';
// 휴대폰번호 체크
$mb_hp = hyphen_hp_number($_POST['mb_hp']);
@ -22,72 +25,101 @@ if($mb_hp) {
}
// 인증정보처리
if($_POST['mb_certify_case'] && $_POST['mb_certify']) {
$mb_certify = $_POST['mb_certify_case'];
$mb_adult = $_POST['mb_adult'];
if($mb_certify_case && $mb_certify) {
$mb_certify = isset($_POST['mb_certify_case']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify_case']) : '';
$mb_adult = isset($_POST['mb_adult']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_adult']) : '';
} else {
$mb_certify = '';
$mb_adult = 0;
}
$mb_zip1 = substr($_POST['mb_zip'], 0, 3);
$mb_zip2 = substr($_POST['mb_zip'], 3);
$mb_zip1 = substr($mb_zip, 0, 3);
$mb_zip2 = substr($mb_zip, 3);
$mb_email = isset($_POST['mb_email']) ? get_email_address(trim($_POST['mb_email'])) : '';
$mb_nick = isset($_POST['mb_nick']) ? trim(strip_tags($_POST['mb_nick'])) : '';
if ($msg = valid_mb_nick($mb_nick)) alert($msg, "", true, true);
$sql_common = " mb_name = '{$_POST['mb_name']}',
$posts = array();
$check_keys = array(
'mb_name',
'mb_homepage',
'mb_tel',
'mb_addr1',
'mb_addr2',
'mb_addr3',
'mb_addr_jibeon',
'mb_signature',
'mb_leave_date',
'mb_intercept_date',
'mb_mailling',
'mb_sms',
'mb_open',
'mb_profile',
'mb_level'
);
for($i=1;$i<=10;$i++){
$check_keys[] = 'mb_'.$i;
}
foreach( $check_keys as $key ){
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : '';
}
$mb_memo = isset($_POST['mb_memo']) ? $_POST['mb_memo'] : '';
$sql_common = " mb_name = '{$posts['mb_name']}',
mb_nick = '{$mb_nick}',
mb_email = '{$mb_email}',
mb_homepage = '{$_POST['mb_homepage']}',
mb_tel = '{$_POST['mb_tel']}',
mb_homepage = '{$posts['mb_homepage']}',
mb_tel = '{$posts['mb_tel']}',
mb_hp = '{$mb_hp}',
mb_certify = '{$mb_certify}',
mb_adult = '{$mb_adult}',
mb_zip1 = '$mb_zip1',
mb_zip2 = '$mb_zip2',
mb_addr1 = '{$_POST['mb_addr1']}',
mb_addr2 = '{$_POST['mb_addr2']}',
mb_addr3 = '{$_POST['mb_addr3']}',
mb_addr_jibeon = '{$_POST['mb_addr_jibeon']}',
mb_signature = '{$_POST['mb_signature']}',
mb_leave_date = '{$_POST['mb_leave_date']}',
mb_intercept_date='{$_POST['mb_intercept_date']}',
mb_memo = '{$_POST['mb_memo']}',
mb_mailling = '{$_POST['mb_mailling']}',
mb_sms = '{$_POST['mb_sms']}',
mb_open = '{$_POST['mb_open']}',
mb_profile = '{$_POST['mb_profile']}',
mb_level = '{$_POST['mb_level']}',
mb_1 = '{$_POST['mb_1']}',
mb_2 = '{$_POST['mb_2']}',
mb_3 = '{$_POST['mb_3']}',
mb_4 = '{$_POST['mb_4']}',
mb_5 = '{$_POST['mb_5']}',
mb_6 = '{$_POST['mb_6']}',
mb_7 = '{$_POST['mb_7']}',
mb_8 = '{$_POST['mb_8']}',
mb_9 = '{$_POST['mb_9']}',
mb_10 = '{$_POST['mb_10']}' ";
mb_addr1 = '{$posts['mb_addr1']}',
mb_addr2 = '{$posts['mb_addr2']}',
mb_addr3 = '{$posts['mb_addr3']}',
mb_addr_jibeon = '{$posts['mb_addr_jibeon']}',
mb_signature = '{$posts['mb_signature']}',
mb_leave_date = '{$posts['mb_leave_date']}',
mb_intercept_date='{$posts['mb_intercept_date']}',
mb_memo = '{$mb_memo}',
mb_mailling = '{$posts['mb_mailling']}',
mb_sms = '{$posts['mb_sms']}',
mb_open = '{$posts['mb_open']}',
mb_profile = '{$posts['mb_profile']}',
mb_level = '{$posts['mb_level']}',
mb_1 = '{$posts['mb_1']}',
mb_2 = '{$posts['mb_2']}',
mb_3 = '{$posts['mb_3']}',
mb_4 = '{$posts['mb_4']}',
mb_5 = '{$posts['mb_5']}',
mb_6 = '{$posts['mb_6']}',
mb_7 = '{$posts['mb_7']}',
mb_8 = '{$posts['mb_8']}',
mb_9 = '{$posts['mb_9']}',
mb_10 = '{$posts['mb_10']}' ";
if ($w == '')
{
$mb = get_member($mb_id);
if ($mb['mb_id'])
if (isset($mb['mb_id']) && $mb['mb_id'])
alert('이미 존재하는 회원아이디입니다.\\n : '.$mb['mb_id'].'\\n이름 : '.$mb['mb_name'].'\\n닉네임 : '.$mb['mb_nick'].'\\n메일 : '.$mb['mb_email']);
// 닉네임중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
if (isset($row['mb_id']) && $row['mb_id'])
alert('이미 존재하는 닉네임입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
// 이메일중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
if (isset($row['mb_id']) && $row['mb_id'])
alert('이미 존재하는 이메일입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
sql_query(" insert into {$g5['member_table']} set mb_id = '{$mb_id}', mb_password = '".get_encrypt_string($mb_password)."', mb_datetime = '".G5_TIME_YMDHIS."', mb_ip = '{$_SERVER['REMOTE_ADDR']}', mb_email_certify = '".G5_TIME_YMDHIS."', {$sql_common} ");
@ -95,7 +127,7 @@ if ($w == '')
else if ($w == 'u')
{
$mb = get_member($mb_id);
if (!$mb['mb_id'])
if (! (isset($mb['mb_id']) && $mb['mb_id']))
alert('존재하지 않는 회원자료입니다.');
if ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level'])
@ -105,19 +137,19 @@ else if ($w == 'u')
alert('최고관리자의 비밀번호를 수정할수 없습니다.');
}
if ($_POST['mb_id'] == $member['mb_id'] && $_POST['mb_level'] != $mb['mb_level'])
if ($mb_id === $member['mb_id'] && $_POST['mb_level'] != $mb['mb_level'])
alert($mb['mb_id'].' : 로그인 중인 관리자 레벨은 수정 할 수 없습니다.');
// 닉네임중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' and mb_id <> '$mb_id' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
if (isset($row['mb_id']) && $row['mb_id'])
alert('이미 존재하는 닉네임입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
// 이메일중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' and mb_id <> '$mb_id' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
if (isset($row['mb_id']) && $row['mb_id'])
alert('이미 존재하는 이메일입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
if ($mb_password)
@ -125,7 +157,7 @@ else if ($w == 'u')
else
$sql_password = "";
if ($passive_certify)
if (isset($passive_certify) && $passive_certify)
$sql_certify = " , mb_email_certify = '".G5_TIME_YMDHIS."' ";
else
$sql_certify = "";
@ -146,7 +178,7 @@ if( $w == '' || $w == 'u' ){
$mb_icon_img = get_mb_icon_name($mb_id).'.gif';
// 회원 아이콘 삭제
if ($del_mb_icon)
if (isset($del_mb_icon) && $del_mb_icon)
@unlink(G5_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_icon_img);
$image_regex = "/(\.(gif|jpe?g|png))$/i";
@ -196,7 +228,7 @@ if( $w == '' || $w == 'u' ){
$mb_img_dir .= substr($mb_id,0,2);
// 회원 이미지 삭제
if ($del_mb_img)
if (isset($del_mb_img) && $del_mb_img)
@unlink($mb_img_dir.'/'.$mb_icon_img);
// 아이콘 업로드
@ -238,5 +270,4 @@ if( $w == '' || $w == 'u' ){
run_event('admin_member_form_update', $w, $mb_id);
goto_url('./member_form.php?'.$qstr.'&amp;w=u&amp;mb_id='.$mb_id, false);
?>
goto_url('./member_form.php?'.$qstr.'&amp;w=u&amp;mb_id='.$mb_id, false);