multiple SERVER_PORT references updated to use HTTP_HOST
This commit is contained in:
@@ -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']);
|
||||
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user