From 9784bb92f8c9ebdf665848d3cdcc4ee92924c718 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 23 Feb 2023 11:54:35 +0900 Subject: [PATCH] fix: remove $allowedHostnames check SiteURI will check. --- system/HTTP/SiteURI.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/system/HTTP/SiteURI.php b/system/HTTP/SiteURI.php index 160a31b4adcb..9d4ccef074d6 100644 --- a/system/HTTP/SiteURI.php +++ b/system/HTTP/SiteURI.php @@ -83,8 +83,7 @@ class SiteURI extends URI /** * @param string $relativePath URI path relative to baseURL. May include * queries or fragments. - * @param string|null $host Optional hostname. If it is not in - * $allowedHostnames, just be ignored. + * @param string|null $host Optional current hostname. * @param string|null $scheme Optional scheme. 'http' or 'https'. * @phpstan-param 'http'|'https'|null $scheme */ @@ -153,7 +152,7 @@ private function determineBaseURL( } // Update host - if ($host !== null && $this->checkHost($host, $configApp->allowedHostnames)) { + if ($host !== null) { $uri->setHost($host); } @@ -187,11 +186,6 @@ private function getIndexPageRoutePath(string $routePath): string return $indexPageRoutePath; } - private function checkHost(string $host, array $allowedHostnames): bool - { - return in_array($host, $allowedHostnames, true); - } - private function normalizeBaseURL(App $configApp): string { // It's possible the user forgot a trailing slash on their