multiple SERVER_PORT references updated to use HTTP_HOST
This commit is contained in:
@@ -199,7 +199,7 @@ class Installer
|
||||
|
||||
$http = G::is_https() ? 'https' : 'http';
|
||||
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
|
||||
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] !== '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
|
||||
$host = $_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']);
|
||||
$workspace = $this->options['name'];
|
||||
|
||||
$endpoint = sprintf(
|
||||
|
||||
@@ -1645,10 +1645,8 @@ class System
|
||||
*/
|
||||
public static function getServerPort()
|
||||
{
|
||||
$port = "";
|
||||
if (isset($_SERVER['SERVER_PORT'])) {
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
} else if (defined('SERVER_PORT')) {
|
||||
$port = "80";
|
||||
if (defined('SERVER_PORT')) {
|
||||
$port = SERVER_PORT;
|
||||
}
|
||||
return $port;
|
||||
|
||||
@@ -148,7 +148,7 @@ class Server implements iAuthenticate
|
||||
public function index()
|
||||
{
|
||||
$http = \G::is_https() ? 'https' : 'http';
|
||||
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
|
||||
$host = $_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']);
|
||||
$host = $http .'://'. $host;
|
||||
|
||||
$applicationsLink = sprintf('%s/%s/oauth2/apps', $host, config("system.workspace"));
|
||||
@@ -184,7 +184,7 @@ class Server implements iAuthenticate
|
||||
|
||||
if (! isset($_SESSION['USER_LOGGED'])) {
|
||||
$http = \G::is_https() ? 'https' : 'http';
|
||||
$host = $http . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
|
||||
$host = $http . '://' . $_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']);
|
||||
$redirect = urlencode('/'.self::$workspace.$_SERVER['REQUEST_URI']);
|
||||
|
||||
$loginLink = sprintf('%s/sys%s/%s/%s/login/login?u=%s', $host, config("system.workspace"), SYS_LANG, SYS_SKIN, $redirect);
|
||||
|
||||
Reference in New Issue
Block a user