mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 13:32:41 +08:00
encrypt download url
This commit is contained in:
@@ -423,9 +423,12 @@ function isHttps()
|
||||
|
||||
function getSchemeAndHttpHost()
|
||||
{
|
||||
global $BASEURL;
|
||||
if (isRunningInConsole()) {
|
||||
return $BASEURL;
|
||||
}
|
||||
$isHttps = isHttps();
|
||||
$protocol = $isHttps ? 'https' : 'http';
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
|
||||
return $result;
|
||||
|
||||
@@ -574,3 +577,8 @@ function nexus_trans($key, $replace = [], $locale = null)
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function isRunningInConsole(): bool
|
||||
{
|
||||
return php_sapi_name() == 'cli';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user