Index: startup.php =================================================================== --- startup.php (revision 13128) +++ startup.php (working copy) @@ -54,6 +54,13 @@ $https_mark = getArrayValue($_SERVER, 'HTTPS'); safeDefine('PROTOCOL', ($https_mark == 'on') || ($https_mark == '1') ? 'https://' : 'http://'); + $port = array_key_exists('HTTP_PORT', $_SERVER) ? $_SERVER['HTTP_PORT'] : false; + + if ($port && ((PROTOCOL == 'http://' && $port != '80') || (PROTOCOL == 'https://' && $port != '443'))) { + // if non-standard port is used, then define it + define('PORT', $_SERVER['HTTP_PORT']); + } + safeDefine('APPLICATION_CLASS', isset($vars['ApplicationClass']) ? $vars['ApplicationClass'] : 'kApplication'); safeDefine('APPLICATION_PATH', isset($vars['ApplicationPath']) ? $vars['ApplicationPath'] : '/core/kernel/application.php');