mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
fix getSchemeAndHttpHost()
This commit is contained in:
@@ -11,8 +11,7 @@ if (!file_exists($rootpath . '.env')) {
|
|||||||
$installScriptRelativePath = 'install/install.php';
|
$installScriptRelativePath = 'install/install.php';
|
||||||
$installScriptFile = $rootpath . "public/$installScriptRelativePath";
|
$installScriptFile = $rootpath . "public/$installScriptRelativePath";
|
||||||
if (file_exists($installScriptFile)) {
|
if (file_exists($installScriptFile)) {
|
||||||
header('Location: ' . getBaseUrl() . '/' . $installScriptRelativePath);
|
redirect($installScriptRelativePath);
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ini_set('date.timezone', config('nexus.timezone'));
|
ini_set('date.timezone', config('nexus.timezone'));
|
||||||
|
|||||||
@@ -4534,7 +4534,10 @@ function getFullDirectory($dir)
|
|||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
$dir = ROOT_PATH . $dir;
|
$dir = ROOT_PATH . $dir;
|
||||||
}
|
}
|
||||||
|
if (is_dir($dir)) {
|
||||||
return realpath($dir);
|
return realpath($dir);
|
||||||
|
}
|
||||||
|
return $dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkGuestVisit()
|
function checkGuestVisit()
|
||||||
|
|||||||
@@ -403,9 +403,10 @@ function getSchemeAndHttpHost()
|
|||||||
$protocol = $isHttps ? 'https' : 'http';
|
$protocol = $isHttps ? 'https' : 'http';
|
||||||
$port = $_SERVER['SERVER_PORT'];
|
$port = $_SERVER['SERVER_PORT'];
|
||||||
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
|
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
|
||||||
if ((!$isHttps && $port != 80) || ($isHttps && $port != 443)) {
|
//HTTP_HOST include port
|
||||||
$result .= ":$port";
|
// if ((!$isHttps && $port != 80) || ($isHttps && $port != 443)) {
|
||||||
}
|
// $result .= ":$port";
|
||||||
|
// }
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,8 +261,7 @@ class Install
|
|||||||
|
|
||||||
public function gotoStep($step)
|
public function gotoStep($step)
|
||||||
{
|
{
|
||||||
header('Location: ' . getBaseUrl() . "?step=$step");
|
redirect(getBaseUrl() . "?step=$step");
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function maxStep()
|
public function maxStep()
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST")
|
|||||||
$pp=pathinfo($filename = $file["name"]);
|
$pp=pathinfo($filename = $file["name"]);
|
||||||
if($pp['basename'] != $filename)
|
if($pp['basename'] != $filename)
|
||||||
stderr($lang_bitbucketupload['std_upload_failed'], $lang_bitbucketupload['std_bad_file_name']);
|
stderr($lang_bitbucketupload['std_upload_failed'], $lang_bitbucketupload['std_bad_file_name']);
|
||||||
$tgtfile = "$bitbucket/$filename";
|
$tgtfile = getFullDirectory("$bitbucket/$filename");
|
||||||
if (file_exists($tgtfile))
|
if (file_exists($tgtfile))
|
||||||
stderr($lang_bitbucketupload['std_upload_failed'], $lang_bitbucketupload['std_file_already_exists'].htmlspecialchars($filename).$lang_bitbucketupload['std_already_exists'],false);
|
stderr($lang_bitbucketupload['std_upload_failed'], $lang_bitbucketupload['std_file_already_exists'].htmlspecialchars($filename).$lang_bitbucketupload['std_already_exists'],false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user