diff --git a/common.php b/common.php index 5d7fca050..607732db2 100644 --- a/common.php +++ b/common.php @@ -35,7 +35,7 @@ function g5_path() $server_script_filename = preg_replace('/\/+/', '/', str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME'])); $tilde_remove = preg_replace('/^\/\~[^\/]+(.*)$/', '$1', $server_script_name); $document_root = str_replace($tilde_remove, '', $server_script_filename); - $pattern = '/' . preg_quote($document_root, '/') . '/i'; + $pattern = '/.*?' . preg_quote($document_root, '/') . '/i'; $root = preg_replace($pattern, '', $result['path']); $port = ($_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443) ? '' : ':'.$_SERVER['SERVER_PORT']; $http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 's' : '') . '://'; diff --git a/install/install_db.php b/install/install_db.php index 68e5ac2af..bbe3ee77f 100644 --- a/install/install_db.php +++ b/install/install_db.php @@ -306,7 +306,7 @@ if($g5_install || !$result) { sql_query($sql, true, $dblink); // 게시판 테이블 생성 - $file = file("../adm/sql_write.sql"); + $file = file("../".G5_ADMIN_DIR."/sql_write.sql"); $sql = implode($file, "\n"); $create_table = $table_prefix.'write_' . $tmp_bo_table[$i];