가비아 호스팅에서 설치시 에러 문제 수정

This commit is contained in:
thisgun
2017-12-05 17:10:55 +09:00
parent 907db24187
commit 7831d9dfb6

View File

@ -29,7 +29,8 @@ for ($i=0; $i<$ext_cnt; $i++) {
function g5_path()
{
$result['path'] = str_replace('\\', '/', dirname(__FILE__));
$chroot = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], dirname(__FILE__)));
$result['path'] = str_replace('\\', '/', $chroot.dirname(__FILE__));
$tilde_remove = preg_replace('/^\/\~[^\/]+(.*)$/', '$1', $_SERVER['SCRIPT_NAME']);
$document_root = str_replace($tilde_remove, '', $_SERVER['SCRIPT_FILENAME']);
$pattern = '/' . preg_quote($document_root, '/') . '/i';