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

@ -15,20 +15,20 @@ if (file_exists($dbconfig_file)) {
die(install_json_msg('프로그램이 이미 설치되어 있습니다.'));
}
if (preg_match("/[^0-9a-z_]+/i", $_POST['table_prefix']) ) {
if (isset($_POST['table_prefix']) && preg_match("/[^0-9a-z_]+/i", $_POST['table_prefix']) ) {
die(install_json_msg('TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.'));
}
$mysql_host = safe_install_string_check($_POST['mysql_host'], 'json');
$mysql_user = safe_install_string_check($_POST['mysql_user'], 'json');
$mysql_pass = safe_install_string_check($_POST['mysql_pass'], 'json');
$mysql_db = safe_install_string_check($_POST['mysql_db'], 'json');
$table_prefix= safe_install_string_check(preg_replace('/[^a-zA-Z0-9_]/', '_', $_POST['table_prefix']));
$mysql_host = isset($_POST['mysql_host']) ? safe_install_string_check($_POST['mysql_host'], 'json') : '';
$mysql_user = isset($_POST['mysql_user']) ? safe_install_string_check($_POST['mysql_user'], 'json') : '';
$mysql_pass = isset($_POST['mysql_pass']) ? safe_install_string_check($_POST['mysql_pass'], 'json') : '';
$mysql_db = isset($_POST['mysql_db']) ? safe_install_string_check($_POST['mysql_db'], 'json') : '';
$table_prefix= isset($_POST['table_prefix']) ? safe_install_string_check(preg_replace('/[^a-zA-Z0-9_]/', '_', $_POST['table_prefix'])) : '';
$tmp_str = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
$ajax_token = md5($tmp_str.$_SERVER['REMOTE_ADDR'].dirname(dirname(__FILE__).'/'));
$bool_ajax_token = ($ajax_token == $_POST['ajax_token']) ? true : false;
$bool_ajax_token = (isset($_POST['ajax_token']) && ($ajax_token == $_POST['ajax_token'])) ? true : false;
if( !($mysql_host && $mysql_user && $mysql_pass && $mysql_db && $table_prefix && $bool_ajax_token) ){
die(install_json_msg('잘못된 요청입니다.'));
@ -56,5 +56,4 @@ if(sql_query("DESCRIBE `{$table_prefix}config`", G5_DISPLAY_SQL_ERROR, $dblink))
die(install_json_msg('주의! 이미 테이블이 존재하므로, 기존 DB 자료가 망실됩니다. 계속 진행하겠습니까?', 'exists'));
}
die(install_json_msg('ok', 'success'));
?>
die(install_json_msg('ok', 'success'));

View File

@ -50,5 +50,4 @@ function frm_submit(f)
?>
<?php
include_once ('./install.inc2.php');
?>
include_once ('./install.inc2.php');

View File

@ -1,6 +1,26 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if( ! function_exists('array_map_deep') ){
// multi-dimensional array에 사용자지정 함수적용
function array_map_deep($fn, $array)
{
if(is_array($array)) {
foreach($array as $key => $value) {
if(is_array($value)) {
$array[$key] = array_map_deep($fn, $value);
} else {
$array[$key] = call_user_func($fn, $value);
}
}
} else {
$array = call_user_func($fn, $array);
}
return $array;
}
}
if( ! function_exists('safe_install_string_check') ){
function safe_install_string_check( $str, $is_json=false ) {
$is_check = false;
@ -23,7 +43,7 @@ if( ! function_exists('safe_install_string_check') ){
die($msg);
}
return $str;
return array_map_deep('stripslashes', $str);
}
}
@ -36,5 +56,4 @@ if( ! function_exists('install_json_msg') ){
return json_encode(array('error'=>$error_msg, 'success'=>$success_msg, 'exists'=>$exists_msg));
}
}
?>
}

View File

@ -2,7 +2,7 @@
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$data_path = '../'.G5_DATA_DIR;
if (!$title) $title = G5_VERSION." 설치";
if (! (isset($title) && $title)) $title = G5_VERSION." 설치";
?>
<!doctype html>
<html lang="ko">
@ -92,5 +92,4 @@ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
$write_data_dir = false;
}
}
}
?>
}

View File

@ -202,5 +202,4 @@ function frm_install_submit(f)
</script>
<?php
include_once ('./install.inc2.php');
?>
include_once ('./install.inc2.php');

View File

@ -23,15 +23,15 @@ include_once ('./install.inc.php');
//print_r($_POST); exit;
$mysql_host = safe_install_string_check($_POST['mysql_host']);
$mysql_user = safe_install_string_check($_POST['mysql_user']);
$mysql_pass = safe_install_string_check($_POST['mysql_pass']);
$mysql_db = safe_install_string_check($_POST['mysql_db']);
$table_prefix= safe_install_string_check($_POST['table_prefix']);
$admin_id = $_POST['admin_id'];
$admin_pass = $_POST['admin_pass'];
$admin_name = $_POST['admin_name'];
$admin_email = $_POST['admin_email'];
$mysql_host = isset($_POST['mysql_host']) ? safe_install_string_check($_POST['mysql_host']) : '';
$mysql_user = isset($_POST['mysql_user']) ? safe_install_string_check($_POST['mysql_user']) : '';
$mysql_pass = isset($_POST['mysql_pass']) ? safe_install_string_check($_POST['mysql_pass']) : '';
$mysql_db = isset($_POST['mysql_db']) ? safe_install_string_check($_POST['mysql_db']) : '';
$table_prefix= isset($_POST['table_prefix']) ? safe_install_string_check($_POST['table_prefix']) : '';
$admin_id = isset($_POST['admin_id']) ? $_POST['admin_id'] : '';
$admin_pass = isset($_POST['admin_pass']) ? $_POST['admin_pass'] : '';
$admin_name = isset($_POST['admin_name']) ? $_POST['admin_name'] : '';
$admin_email = isset($_POST['admin_email']) ? $_POST['admin_email'] : '';
if (preg_match("/[^0-9a-z_]+/i", $table_prefix) ) {
die('<div class="ins_inner"><p>TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.</p><div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div></div>');
@ -426,5 +426,4 @@ fclose($f);
</div>
<?php
include_once ('./install.inc2.php');
?>
include_once ('./install.inc2.php');

View File

@ -5,5 +5,4 @@ if(!extension_loaded('gd') || !function_exists('gd_info')) {
echo '<script>'.PHP_EOL;
echo 'alert("'.G5_VERSION.'의 정상적인 사용을 위해서는 GD 라이브러리가 필요합니다.\nGD 라이브러리가 없을 경우 자동등록방지 문자와 썸네일 기능이 작동하지 않습니다.");'.PHP_EOL;
echo '</script>'.PHP_EOL;
}
?>
}