mirror of
https://github.com/humhub/humhub.git
synced 2025-04-20 23:21:54 +02:00
Improve SelfTest for Base URL
This commit is contained in:
parent
c238611a65
commit
3605afc529
@ -15,6 +15,7 @@ use humhub\modules\marketplace\Module;
|
||||
use humhub\services\MigrationService;
|
||||
use Yii;
|
||||
use yii\helpers\UnsetArrayValue;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
* SelfTest is a helper class which checks all dependencies of the application.
|
||||
@ -430,16 +431,7 @@ class SelfTest
|
||||
}
|
||||
|
||||
$title = Yii::t('AdminModule.information', 'Settings') . ' - ' . Yii::t('AdminModule.information', 'Base URL');
|
||||
$scheme = Yii::$app->request->getIsSecureConnection() ? 'https' : 'http';
|
||||
$port = Yii::$app->request->getServerPort();
|
||||
$currentBaseUrl = $scheme . '://' . preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST'])
|
||||
. (
|
||||
($scheme === 'https' && $port == 443) ||
|
||||
($scheme === 'http' && $port == 80)
|
||||
? ''
|
||||
: ':' . $port
|
||||
)
|
||||
. ($_SERVER['BASE'] ?? '');
|
||||
$currentBaseUrl = Url::base(true);
|
||||
if ($currentBaseUrl === Yii::$app->settings->get('baseUrl')) {
|
||||
$checks[] = [
|
||||
'title' => $title,
|
||||
|
@ -21,7 +21,7 @@ use humhub\modules\user\models\ProfileField;
|
||||
use humhub\modules\user\models\ProfileFieldCategory;
|
||||
use Yii;
|
||||
use yii\base\Exception;
|
||||
use yii\helpers\BaseUrl;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
* InitialData
|
||||
@ -37,7 +37,7 @@ class InitialData
|
||||
return;
|
||||
}
|
||||
|
||||
Yii::$app->settings->set('baseUrl', BaseUrl::base(true));
|
||||
Yii::$app->settings->set('baseUrl', Url::base(true));
|
||||
Yii::$app->settings->set('paginationSize', 10);
|
||||
Yii::$app->settings->set('displayNameFormat', '{profile.firstname} {profile.lastname}');
|
||||
Yii::$app->settings->set('horImageScrollOnMobile', true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user