php 버전이 지원하는 버전보다 낮습니다." . PHP_EOL; echo "

지원하는 최소 php 버전은 5.6.0 이상입니다.

" . PHP_EOL; echo "

현재 php 버전은 " . PHP_VERSION . " 입니다.

" . PHP_EOL; exit(); } /** * Load require class and others * @param mixed $base_dir * @throws \Exception * @return string[] */ function load_libs($base_dir, $load_type = "class") { $base_path = realpath($base_dir); if ($base_path === false) { throw new Exception("지정된 기본 디렉토리를 찾을 수 없습니다: $base_dir"); } $loaded_files = []; $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($base_path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST ); foreach ($iterator as $file) { try { if ($file->isDir()) { $parent_folder_name = $file->getFilename(); $class_file = $file->getPathname() . DIRECTORY_SEPARATOR . "{$parent_folder_name}.{$load_type}.php"; if (file_exists($class_file)) { require_once $class_file; $loaded_files[] = $class_file; } } } catch (Exception $x) { } } return $loaded_files; } /** * custom function from arcturus * https://info.drk.st/about * @param string $currentDir * @return string */ function get_url_path_from_root($currentDir = __DIR__) { $documentRoot = rtrim($_SERVER["DOCUMENT_ROOT"], '/'); $relativePath = str_replace($documentRoot, '', $currentDir); $urlPath = str_replace(DIRECTORY_SEPARATOR, '/', $relativePath); return rtrim($urlPath, '/'); } /** * custom function from arcturus * https://info.drk.st/about * @param string $type * @param string $path * @param array $args * @return string|void */ function get_embed_file($type, $path, ...$args) { if (file_exists($path)) { $full_path = ""; if (strstr($path, $_SERVER["DOCUMENT_ROOT"])) { $full_path = $path; $path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); } else { $full_path = $_SERVER["DOCUMENT_ROOT"] . $path; } $url_path = get_url_path_from_root(dirname($full_path)); $url = $url_path . '/' . basename($path); switch ($type) { case "script": return ""; case "css": case "stylesheet": return ""; } } } /** * get gnuboard path * @return string[] */ function g5_path() { $result = []; $result['path'] = str_replace('\\', '/', __DIR__); $script_name = $_SERVER['SCRIPT_NAME']; $script_filename = $_SERVER['SCRIPT_FILENAME']; $document_root = substr($script_filename, 0, -strlen($script_name)); $root = substr($result['path'], strlen($document_root)); $port = ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ':' . $_SERVER['SERVER_PORT'] : ''; $is_https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on'; $http = $is_https ? 'https://' : 'http://'; $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; $host = preg_replace('/:\d+$/', '', $host); $host = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*]/", '', $host); $result['url'] = $http . $host . $port . $root; return $result; } // multi-dimensional array에 사용자지정 함수적용 function array_map_deep($fn, $array) { if (is_array($array)) { foreach ($array as $key => $value) { $array[$key] = is_array($value) ? array_map_deep($fn, $value) : call_user_func($fn, $value); } } else { $array = call_user_func($fn, $array); } return $array; } // SQL Injection 대응 문자열 필터링 function sql_escape_string($str) { if (defined('G5_ESCAPE_PATTERN') && defined('G5_ESCAPE_REPLACE')) { $pattern = G5_ESCAPE_PATTERN; $replace = G5_ESCAPE_REPLACE; if ($pattern) $str = preg_replace($pattern, $replace, $str); } $str = call_user_func('addslashes', $str); return $str; } function strip_slashes_deep($value) { return is_array($value) ? array_map('strip_slashes_deep', $value) : stripslashes($value); } include_once __DIR__ . "/classes/event_handler.php"; $extra_headers = [ 'HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_HOST', 'HTTP_X_FORWARDED_PROTO', 'HTTP_X_FORWARDED_SSL', ]; // filter for dynamic variables $var_filter = [ 'PHP_SELF', '_ENV', '_GET', '_POST', '_FILES', '_SERVER', '_COOKIE', '_SESSION', '_REQUEST', 'HTTP_ENV_VARS', 'HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_POST_FILES', 'HTTP_SERVER_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SESSION_VARS', 'GLOBALS' ]; foreach ($var_filter as $val) { if (array_key_exists($val, $_GET) && isset($_GET[$val])) { unset($_GET[$val]); } if (array_key_exists($val, $_POST) && isset($_POST[$val])) { unset($_POST[$val]); } } $g5_path = g5_path(); // gnuboard5 configuration file include_once $g5_path['path'] . '/config.php'; $_system = new stdClass; $_system->g5_path = $g5_path; $_system->classes = load_libs(__DIR__ . "/classes", "class"); define("__ADVDIR__", __DIR__); $_system->addons = load_libs(__DIR__ . "/addons", "addon"); // future update... maybe // $_system->modules = load_libs(__DIR__ . "/modules", "model"); // $_system->modules = load_libs(__DIR__ . "/modules"); // arc: 이 이벤트는 before 가 없습니다. EventHandler::triggerEvent("gnuboard.loadlibs.after", $_system); unset($g5_path); // Cloudflare 환경을 고려한 https 사용여부 if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === "https") { $_SERVER['HTTPS'] = 'on'; } // magic_quotes_gpc 에 의한 backslashes 제거 if (version_compare(PHP_VERSION, '7.0.0', '<')) { if (version_compare(PHP_VERSION, '5.6.0', '>=')) { if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { $_POST = array_map('strip_slashes_deep', $_POST); $_GET = array_map('strip_slashes_deep', $_GET); $_COOKIE = array_map('strip_slashes_deep', $_COOKIE); $_REQUEST = array_map('strip_slashes_deep', $_REQUEST); } } else { die("php 버전이 너무 낮습니다."); } } // sql_escape_string 적용 $_POST = array_map_deep(G5_ESCAPE_FUNCTION, $_POST); $_GET = array_map_deep(G5_ESCAPE_FUNCTION, $_GET); $_COOKIE = array_map_deep(G5_ESCAPE_FUNCTION, $_COOKIE); $_REQUEST = array_map_deep(G5_ESCAPE_FUNCTION, $_REQUEST); // PHP 4.1.0 부터 지원됨 // php.ini 의 register_globals=off 일 경우 @extract($_GET); @extract($_POST); @extract($_SERVER); // 완두콩님이 알려주신 보안관련 오류 수정 // $member 에 값을 직접 넘길 수 있음 $config = []; $member = [ 'mb_id' => '', 'mb_level' => 1, 'mb_name' => '', 'mb_point' => 0, 'mb_certify' => '', 'mb_email' => '', 'mb_open' => '', 'mb_homepage' => '', 'mb_tel' => '', 'mb_hp' => '', 'mb_zip1' => '', 'mb_zip2' => '', 'mb_addr1' => '', 'mb_addr2' => '', 'mb_addr3' => '', 'mb_addr_jibeon' => '', 'mb_signature' => '', 'mb_profile' => '' ]; $board = [ 'bo_table' => '', 'bo_skin' => '', 'bo_mobile_skin' => '', 'bo_upload_count' => 0, 'bo_use_dhtml_editor' => '', 'bo_subject' => '', 'bo_image_width' => 0 ]; $group = [ 'gr_device' => '', 'gr_subject' => '' ]; $article = []; $g5 = []; if (version_compare(phpversion(), '8.0.0', '>=')) { $g5 = ['title' => '']; } $qaconfig = []; $g5_debug = [ 'php' => [], 'sql' => [] ]; include_once G5_LIB_PATH . '/hook.lib.php'; include_once G5_LIB_PATH . '/get_data.lib.php'; include_once G5_LIB_PATH . '/cache.lib.php'; include_once G5_LIB_PATH . '/url.lib.php'; $g5_object = new G5_object_cache(); //============================================================================== // 공통 //------------------------------------------------------------------------------ $dbconfig_file = G5_DATA_PATH . '/' . G5_DBCONFIG_FILE; if (file_exists($dbconfig_file)) { include_once $dbconfig_file; include_once G5_LIB_PATH . '/common.lib.php'; // 공통 라이브러리 $g5["font_table"] = G5_TABLE_PREFIX . "editor_fonts"; $connect_db = sql_connect(G5_MYSQL_HOST, G5_MYSQL_USER, G5_MYSQL_PASSWORD) or die('MySQL Connect Error!!!'); $select_db = sql_select_db(G5_MYSQL_DB, $connect_db) or die('MySQL DB Error!!!'); // mysql connect resource $g5 배열에 저장 - 명랑폐인님 제안 $g5['connect_db'] = $connect_db; sql_set_charset('utf8', $connect_db); if (defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE) sql_query("SET SESSION sql_mode = ''"); if (defined('G5_TIMEZONE')) sql_query(" set time_zone = '" . G5_TIMEZONE . "'"); } else { ?> 오류! <?php echo G5_VERSION ?> 설치하기
AVOCADO EDITION Message

아보카도 에디션을 먼저 설치해주십시오.

다음 파일을 찾을 수 없습니다.

아보카도 에디션 설치 후 다시 실행하시기 바랍니다.

설치하기
AVOCADO EDITION

GPL! OPEN SOURCE GNUBOARD

오류! <?php echo G5_VERSION ?> 설치하기
AVOCADO EDITION Message

아보카도 에디션 설정을 완료해주십시오.


아보카도 에디션 라이트 설치가 완료 되었습니다.

하지만, 아보카도 에디션의 디자인 설정이 완료되지 않았습니다.

사이트 관리 화면에서 디자인 설정을 완료하여 주시길 바랍니다. (최소 1번 이상 저장 필요)

관리자 바로가기
AVOCADO EDITION : AMBER

GPL! OPEN SOURCE GNUBOARD

\'\"\\\'\\\"\%\=\(\)\/\^\*]/", "", $sca); $qstr .= '&sca=' . urlencode($sca); } } else { $sca = ''; } if (isset($_REQUEST['sfl'])) { $sfl = trim($_REQUEST['sfl']); $sfl = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*\s\#]/", "", $sfl); if ($sfl) $qstr .= '&sfl=' . urlencode($sfl); // search field (검색 필드) } else { $sfl = ''; } if (isset($_REQUEST['stx'])) { // search text (검색어) $stx = get_search_string(trim($_REQUEST['stx'])); if ($stx || $stx === '0') $qstr .= '&stx=' . urlencode(cut_str($stx, 20, '')); } else { $stx = ''; } if (isset($_REQUEST['sst'])) { $sst = trim($_REQUEST['sst']); $sst = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*\s]/", "", $sst); if ($sst) $qstr .= '&sst=' . urlencode($sst); // search sort (검색 정렬 필드) } else { $sst = ''; } if (isset($_REQUEST['sod'])) { // search order (검색 오름, 내림차순) $sod = preg_match("/^(asc|desc)$/i", $sod) ? $sod : ''; if ($sod) $qstr .= '&sod=' . urlencode($sod); } else { $sod = ''; } if (isset($_REQUEST['sop'])) { // search operator (검색 or, and 오퍼레이터) $sop = preg_match("/^(or|and)$/i", $sop) ? $sop : ''; if ($sop) $qstr .= '&sop=' . urlencode($sop); } else { $sop = ''; } if (isset($_REQUEST['spt'])) { // search part (검색 파트[구간]) $spt = (int) $spt; if ($spt) $qstr .= '&spt=' . urlencode($spt); } else { $spt = ''; } if (isset($_REQUEST['page'])) { // 리스트 페이지 $page = (int) $_REQUEST['page']; if ($page) $qstr .= '&page=' . urlencode($page); } else { $page = ''; } if (isset($_REQUEST['w'])) { $w = substr($w, 0, 2); } else { $w = ''; } /** @var int $wr_id 게시판 글의 ID */ if (isset($_REQUEST['wr_id'])) { $wr_id = (int) $_REQUEST['wr_id']; } else { $wr_id = 0; } if (isset($_REQUEST['bo_table']) && !is_array($_REQUEST['bo_table'])) { $bo_table = preg_replace('/[^a-z0-9_]/i', '', trim($_REQUEST['bo_table'])); $bo_table = substr($bo_table, 0, 20); } else { $bo_table = ''; } // URL ENCODING if (isset($_REQUEST['url'])) { $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', trim($_REQUEST['url'])); $urlencode = urlencode($url); } else { $url = ''; $urlencode = urlencode($_SERVER['REQUEST_URI']); if (defined("G5_DOMAIN")) { $p = @parse_url(G5_DOMAIN ?? ""); $p['path'] = isset($p['path']) ? $p['path'] : '/'; $urlencode = G5_DOMAIN . urldecode(preg_replace("/^" . urlencode($p['path']) . "/", "", $urlencode)); } } if (isset($_REQUEST['gr_id'])) { if (!is_array($_REQUEST['gr_id'])) { $gr_id = preg_replace('/[^a-z0-9_]/i', '', trim($_REQUEST['gr_id'])); } } else { $gr_id = ''; } //=================================== // 자동로그인 부분에서 첫로그인에 포인트 부여하던것을 로그인중일때로 변경하면서 코드도 대폭 수정하였습니다. if ($_SESSION['ss_mb_id']) { // 로그인중이라면 $member = get_member($_SESSION['ss_mb_id']); // 차단된 회원이면 ss_mb_id 초기화 if ($member['mb_intercept_date'] && $member['mb_intercept_date'] <= date("Ymd", G5_SERVER_TIME)) { set_session('ss_mb_id', ''); $member = []; } else { // 오늘 처음 로그인 이라면 if (substr($member['mb_today_login'], 0, 10) != G5_TIME_YMD) { // 첫 로그인 포인트 지급 insert_point($member['mb_id'], $config['cf_login_point'], G5_TIME_YMD . ' 첫로그인', '@login', $member['mb_id'], G5_TIME_YMD); // 오늘의 로그인이 될 수도 있으며 마지막 로그인일 수도 있음 // 해당 회원의 접근일시와 IP 를 저장 $sql = " update {$g5['member_table']} set mb_today_login = '" . G5_TIME_YMDHIS . "', mb_login_ip = '{$_SERVER['REMOTE_ADDR']}' where mb_id = '{$member['mb_id']}' "; sql_query($sql); } } } else { // 자동로그인 --------------------------------------- // 회원아이디가 쿠키에 저장되어 있다면 (3.27) if ($tmp_mb_id = get_cookie('ck_mb_id')) { $tmp_mb_id = substr(preg_replace("/[^a-zA-Z0-9_]*/", "", $tmp_mb_id), 0, 20); // 최고관리자는 자동로그인 금지 if (strtolower($tmp_mb_id) != strtolower($config['cf_admin'])) { $sql = " select mb_password, mb_intercept_date, mb_leave_date, mb_email_certify from {$g5['member_table']} where mb_id = '{$tmp_mb_id}' "; $row = sql_fetch($sql); $key = md5($_SERVER['SERVER_ADDR'] . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $row['mb_password']); // 쿠키에 저장된 키와 같다면 $tmp_key = get_cookie('ck_auto'); if ($tmp_key == $key && $tmp_key) { // 차단, 탈퇴가 아니고 메일인증이 사용이면서 인증을 받았다면 if ( $row['mb_intercept_date'] == '' && $row['mb_leave_date'] == '' && (!$config['cf_use_email_certify'] || preg_match('/[1-9]/', $row['mb_email_certify'])) ) { // 세션에 회원아이디를 저장하여 로그인으로 간주 set_session('ss_mb_id', $tmp_mb_id); // 페이지를 재실행 echo ""; exit; } } // $row 배열변수 해제 unset($row); } } // 자동로그인 end --------------------------------------- } $write = []; $write_table = ""; if ($bo_table) { $board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '$bo_table' "); if ($board['bo_table']) { set_cookie("ck_bo_table", $board['bo_table'], 86400 * 1); $gr_id = $board['gr_id']; $write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름 //$comment_table = $g5['write_prefix'] . $bo_table . $g5['comment_suffix']; // 코멘트 테이블 전체이름 if (isset($wr_id) && $wr_id) $write = sql_fetch(" select * from {$write_table} where wr_id = '$wr_id' "); } } if ($gr_id) { $group = sql_fetch(" select * from {$g5['group_table']} where gr_id = '$gr_id' "); } // 회원, 비회원 구분 $is_member = $is_guest = false; $is_admin = ''; if ($member['mb_id']) { $is_member = true; $is_admin = is_admin($member['mb_id']); $member['mb_dir'] = substr($member['mb_id'], 0, 2); } else { $is_guest = true; $member['mb_id'] = ''; $member['mb_level'] = 1; // 비회원의 경우 회원레벨을 가장 낮게 설정 } if ($is_admin != 'super') { /* // 접근가능 IP $cf_possible_ip = trim($config['cf_possible_ip']); if ($cf_possible_ip) { $is_possible_ip = false; $pattern = explode("\n", $cf_possible_ip); for ($i=0; $iread()) { // php 파일만 include 함 if (preg_match("/(\.php)$/i", $entry)) $extend_file[] = $entry; } if (!empty($extend_file) && is_array($extend_file)) { natsort($extend_file); foreach ($extend_file as $file) { include_once G5_EXTEND_PATH . '/' . $file; } } unset($extend_file); // ----- 테마 추가기능 불러오기 (확장) if (defined('G5_THEME_PATH')) { $extend_file = []; $tmp = dir(G5_THEME_PATH . '/' . G5_EXTEND_DIR); while ($entry = $tmp->read()) { // php 파일만 include 함 if (preg_match("/(\.php)$/i", $entry)) $extend_file[] = $entry; } if (!empty($extend_file) && is_array($extend_file)) { natsort($extend_file); foreach ($extend_file as $file) { include_once G5_THEME_PATH . '/' . G5_EXTEND_DIR . "/" . $file; } } unset($extend_file); } ob_start(); $gmnow = gmdate('D, d M Y H:i:s') . ' GMT'; header('Content-Type: text/html; charset=utf-8'); header('Expires: 0'); // rfc2616 - Section 14.21 header("Last-Modified: {$gmnow}"); header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1 header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1 header('Pragma: no-cache'); // HTTP/1.0 EventHandler::triggerEvent("gnuboard.htmlprocess.before"); $html_process = new html_process(); EventHandler::triggerEvent("gnuboard.htmlprocess.after", $html_process);