Fix Base URL detection on Prerequisites (#7279)

* Fix Base URL detection on Prerequisites

* Autocommit PHP CS Fixer
This commit is contained in:
Yuriy Bakhtin 2024-10-29 15:19:58 +01:00 committed by GitHub
parent 02c663cc5a
commit e10bd87a12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -532,4 +532,4 @@ return [
'defer',
],
],
];
];

View File

@ -437,9 +437,13 @@ class SelfTest
? ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] === 1 || $_SERVER['SERVER_PORT'] == $sslPort ? 'https' : 'http')
: ($_SERVER['SERVER_PORT'] == $sslPort ? 'https' : 'http')
);
$currentBaseUrl = $scheme . '://' . $_SERVER['HTTP_HOST']
. (($scheme === 'https' && $_SERVER['SERVER_PORT'] == $sslPort) ||
($scheme === 'http' && $_SERVER['SERVER_PORT'] == $httpPort) ? '' : ':' . $_SERVER['SERVER_PORT'])
$currentBaseUrl = $scheme . '://' . preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST'])
. (
($scheme === 'https' && $_SERVER['SERVER_PORT'] == $sslPort) ||
($scheme === 'http' && $_SERVER['SERVER_PORT'] == $httpPort)
? ''
: ':' . $_SERVER['SERVER_PORT']
)
. ($_SERVER['BASE'] ?? '');
if ($currentBaseUrl === Yii::$app->settings->get('baseUrl')) {
$checks[] = [