encrypt download url

This commit is contained in:
xiaomlove
2021-06-01 23:33:28 +08:00
parent 87817de415
commit 0852509084
5 changed files with 55 additions and 4 deletions

View File

@@ -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';
}