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); } function chrome_domain_session_name() { // 크롬90버전대부터 아래 도메인을 포함된 주소로 접속시 특정조건에서 세션이 생성 안되는 문제가 있을수 있다. $domain_array = [ '.cafe24.com', // 카페24호스팅 '.dothome.co.kr', // 닷홈호스팅 '.phps.kr', // 스쿨호스팅 '.maru.net', // 마루호스팅 ]; $add_str = ''; $document_root_path = str_replace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT'])); if (G5_PATH !== $document_root_path) { $add_str = substr_count(G5_PATH, '/') . basename(dirname(__FILE__)); } if ($add_str || (isset($_SERVER['HTTP_HOST']) && preg_match('/(' . implode('|', $domain_array) . ')/i', $_SERVER['HTTP_HOST']))) { // 위의 도메인주소를 포함한 url접속시 기본세션이름을 변경한다. if (!defined('G5_SESSION_NAME')) define('G5_SESSION_NAME', 'G5' . $add_str . 'PHPSESSID'); @session_name(G5_SESSION_NAME); } } 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"); // $_system->addons = load_libs(__DIR__ . "/addons", "addon"); define("G5_ADDON_PATH", __DIR__ . "/addons"); // addon loader $_addon_loader = new AddonLoader(G5_ADDON_PATH); $_addon_loader->loadAddons(); // 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"; $g5["addons_config_table"] = G5_TABLE_PREFIX . "addons_config"; $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 { ?>GPL! OPEN SOURCE GNUBOARD
아보카도 에디션 라이트 설치가 완료 되었습니다.
하지만, 아보카도 에디션의 디자인 설정이 완료되지 않았습니다.
사이트 관리 화면에서 디자인 설정을 완료하여 주시길 바랍니다. (최소 1번 이상 저장 필요)
GPL! OPEN SOURCE GNUBOARD