fixed scheme
This commit is contained in:
parent
ae5c8f13ff
commit
cccdf77800
|
|
@ -602,3 +602,25 @@ function is_mobile()
|
||||||
{
|
{
|
||||||
return (new \Jenssegers\Agent\Agent())->isMobile();
|
return (new \Jenssegers\Agent\Agent())->isMobile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前访问协议是否为 https
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function is_secure()
|
||||||
|
{
|
||||||
|
if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') {
|
||||||
|
return true;
|
||||||
|
} elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https') {
|
||||||
|
return true;
|
||||||
|
} elseif (!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') {
|
||||||
|
return true;
|
||||||
|
} elseif (isset($_SERVER['SERVER_PORT']) && intval($_SERVER['SERVER_PORT']) === 443) {
|
||||||
|
return true;
|
||||||
|
} elseif (isset($_SERVER['REQUEST_SCHEME']) && strtolower($_SERVER['REQUEST_SCHEME']) === 'https') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,8 @@ class EnvironmentManager
|
||||||
{
|
{
|
||||||
$results = trans('installer::installer_messages.environment.success');
|
$results = trans('installer::installer_messages.environment.success');
|
||||||
|
|
||||||
$appUrl = $_SERVER['REQUEST_SCHEME'] . "://";
|
$scheme = is_secure() ? 'https' : 'http';
|
||||||
|
$appUrl = $scheme . "://";
|
||||||
if ($_SERVER["SERVER_PORT"] != "80") {
|
if ($_SERVER["SERVER_PORT"] != "80") {
|
||||||
$appUrl .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"];
|
$appUrl .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue