From 273973f4b6ec6e0cd79c28286b193e768bac6414 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 20 Feb 2023 02:23:54 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Uri=20=EA=B8=B0=EB=B3=B8=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20=EB=B0=A9=EB=B2=95=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 2 +- src/kakao/Kakao_REST_API_Helper.php | 5 ++++- src/sammo/WebUtil.php | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index c9e15c41..db73db38 100644 --- a/index.php +++ b/index.php @@ -53,7 +53,7 @@ foreach (ServConfig::getServerList() as $setting) { 삼국지 모의전투 HiDCHe diff --git a/src/kakao/Kakao_REST_API_Helper.php b/src/kakao/Kakao_REST_API_Helper.php index 36a3ffb8..29ce3da8 100644 --- a/src/kakao/Kakao_REST_API_Helper.php +++ b/src/kakao/Kakao_REST_API_Helper.php @@ -85,7 +85,10 @@ class Kakao_REST_API_Helper } if($changeRedirectDomain && key_exists('HTTP_HOST', $_SERVER)){ - $uriObj = Uri::createFromBaseUri(KakaoKey::REDIRECT_URI, $_SERVER['HTTP_HOST']); + $uriObj = Uri::createFromBaseUri( + KakaoKey::REDIRECT_URI, + Uri::createFromServer($_SERVER) + ); $this->REDIRECT_URI = (string)$uriObj; } else{ diff --git a/src/sammo/WebUtil.php b/src/sammo/WebUtil.php index 1b599df2..63369af8 100644 --- a/src/sammo/WebUtil.php +++ b/src/sammo/WebUtil.php @@ -337,8 +337,11 @@ class WebUtil return join("\n", $result); } - public static function replaceDomain(string $origPath, string $newDomain): string{ - $upath = Uri::createFromBaseUri($origPath, $newDomain); + public static function replaceDomain(string $origPath): string{ + $upath = Uri::createFromBaseUri( + $origPath, + Uri::createFromServer($_SERVER) + ); return (string)$upath; } }