From 9393f35ab207e4b6f1afcacc218d7efebb2fe878 Mon Sep 17 00:00:00 2001 From: Julian Fitzell Date: Tue, 29 Oct 2002 23:09:07 +0000 Subject: [PATCH] try to improve automatic path detection git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1600 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- config_defaults_inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config_defaults_inc.php b/config_defaults_inc.php index 6c12f5c554..6175efa8bc 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -42,7 +42,18 @@ # path to your installation as seen from the web browser # requires trailing / if ( isset( $_SERVER['SERVER_NAME'] ) && isset ( $_SERVER['PHP_SELF'] ) ) { - $g_path = 'http://' . $_SERVER['SERVER_NAME'] . dirname( $_SERVER['PHP_SELF'] ) . '/'; + $t_host = $_SERVER['SERVER_NAME']; + $t_port = ':' . $_SERVER['SERVER_PORT']; + if ( ':80' == $t_port ) { + $t_port = ''; + } + + $t_path = dirname( $_SERVER['PHP_SELF'] ); + if ( '/' == $t_path || '\\' == $t_path ) { + $t_path = ''; + } + + $g_path = 'http://' . $t_host . $t_port . $t_path . '/'; } else { $g_path = 'http://yourhostnamehere/mantis/'; }