multiple SERVER_PORT references updated to use HTTP_HOST

This commit is contained in:
IsaiDiaz
2025-07-02 12:07:52 -04:00
parent ba7e70fcd9
commit 615f0ff5a0
14 changed files with 24 additions and 24 deletions

View File

@@ -308,6 +308,9 @@ try {
$_CSERVER = $_SERVER;
unset($_CSERVER['REQUEST_TIME']);
unset($_CSERVER['REMOTE_PORT']);
$host = '';
$port = 80;
if (!empty($_SERVER['HTTP_HOST'])) {
$hostParts = explode(':', $_SERVER['HTTP_HOST']);

View File

@@ -8,7 +8,7 @@ if (! empty($_GET['error'])) {
}
$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']);
$endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, config("system.workspace"));
$code = empty($_GET['code']) ? 'NN' : $_GET['code'];

View File

@@ -4,9 +4,8 @@ $filewsdl = PATH_METHODS . 'services' . PATH_SEP . 'pmos2.wsdl';
$content = file_get_contents($filewsdl);
$http = G::is_https() ? 'https' : 'http';
$port = $_SERVER['SERVER_PORT'] === '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . config("system.workspace") . '/' . $lang . '/lurana/services/soap2';
$endpoint = $http . '://' . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . $lang . '/lurana/services/soap2';
$content = str_replace("___SOAP_ADDRESS___", $endpoint, $content);