From 0b4fe3148fc02d5466e31a840dcf11d7dca4594b Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 30 Jul 2014 10:40:16 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=ED=8A=B8=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=EB=90=98=EB=8A=94=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index b689a7791..5e528a392 100644 --- a/common.php +++ b/common.php @@ -35,7 +35,10 @@ function g5_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']); - $result['url'] = $http.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']).$port.$user.$root; + $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); + $result['url'] = $http.$host.$port.$user.$root; return $result; }