mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
fix tracker url and takeinvite.php
This commit is contained in:
@@ -15,7 +15,7 @@ if (!file_exists($rootpath . '.env')) {
|
||||
$installScriptRelativePath = 'install/install.php';
|
||||
$installScriptFile = $rootpath . "public/$installScriptRelativePath";
|
||||
if (file_exists($installScriptFile)) {
|
||||
header('Location: ' . getBaseUrl() . $installScriptRelativePath);
|
||||
header('Location: ' . getBaseUrl() . '/' . $installScriptRelativePath);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2715,6 +2715,9 @@ function set_langfolder_cookie($folder, $expires = 0x7fffffff)
|
||||
function get_protocol_prefix()
|
||||
{
|
||||
global $securelogin;
|
||||
if (isHttps()) {
|
||||
return "https://";
|
||||
}
|
||||
if ($securelogin == "yes") {
|
||||
return "https://";
|
||||
} elseif ($securelogin == "no") {
|
||||
|
||||
@@ -387,10 +387,16 @@ function arr_set(&$array, $key, $value)
|
||||
return $array;
|
||||
}
|
||||
|
||||
function isHttps()
|
||||
{
|
||||
$result = !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) !== 'off');
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
function getSchemeAndHttpHost()
|
||||
{
|
||||
$isHttps = !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) !== 'off');
|
||||
$isHttps = isHttps();
|
||||
$protocol = $isHttps ? 'https' : 'http';
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
|
||||
@@ -411,5 +417,5 @@ function getBaseUrl()
|
||||
} else {
|
||||
$url .= $requestUri;
|
||||
}
|
||||
return $url;
|
||||
return trim($url, '/');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user