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 ""; } } } include_once __DIR__ . "/classes/event/event_handler.php"; $_system = new stdClass; $_system->classes = load_libs(__DIR__ . "/classes", "class"); $_system->addons = load_libs(__DIR__ . "/addons", "addon"); // $_system->modules = load_libs(__DIR__ . "/modules", "model"); // $_system->modules = load_libs(__DIR__ . "/modules"); // arc: 이 이벤트는 before 가 없습니다. EventHandler::triggerEvent("gnuboard.loadlibs.after", $_system); function g5_path() { $result['path'] = str_replace('\\', '/', dirname(__FILE__)); $tilde_remove = preg_replace('/^\/\~[^\/]+(.*)$/', '$1', $_SERVER['SCRIPT_NAME']); $document_root = str_replace($tilde_remove, '', $_SERVER['SCRIPT_FILENAME']); $root = str_replace($document_root, '', $result['path']); $port = $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : ''; $http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://'; $user = str_replace(str_replace($document_root, '', $_SERVER['SCRIPT_FILENAME']), '', $_SERVER['SCRIPT_NAME']); $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; if (isset($_SERVER['HTTP_HOST']) && preg_match('/:[0-9]+$/', $host)) $host = preg_replace('/:[0-9]+$/', '', $host); $host = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*]/", '', $host); $result['url'] = $http . $host . $port . $user . $root; return $result; } $g5_path = g5_path(); include_once $g5_path['path'] . '/config.php'; // 설정 파일 unset($g5_path); // Cloudflare 환경을 고려한 https 사용여부 if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === "https") { $_SERVER['HTTPS'] = 'on'; } // 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; } //============================================================================== // SQL Injection 등으로 부터 보호를 위해 sql_escape_string() 적용 //------------------------------------------------------------------------------ function strip_slashes_deep($value) { return is_array($value) ? array_map('strip_slashes_deep', $value) : stripslashes($value); } // 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 { ?>
GPL! OPEN SOURCE GNUBOARD
아보카도 에디션 라이트 설치가 완료 되었습니다.
하지만, 아보카도 에디션의 디자인 설정이 완료되지 않았습니다.
사이트 관리 화면에서 디자인 설정을 완료하여 주시길 바랍니다. (최소 1번 이상 저장 필요)
GPL! OPEN SOURCE GNUBOARD