From 5c7dc4bbad2e866713faf2b4cf73c1f9148c7001 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 29 Jan 2007 11:56:31 +0000 Subject: Strip port 80 from HTTP_HOST. Fixes #238 and #245 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@871 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wpmu-settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'wpmu-settings.php') diff --git a/wpmu-settings.php b/wpmu-settings.php index c7a48fa..ad5f9c2 100644 --- a/wpmu-settings.php +++ b/wpmu-settings.php @@ -8,7 +8,12 @@ $domain = addslashes( $_SERVER['HTTP_HOST'] ); if( substr( $domain, 0, 4 ) == 'www.' ) $domain = substr( $domain, 4 ); if( strpos( $domain, ':' ) ) { - die( 'WPMU only works without the port number in the URL.' ); + if( substr( $domain, -3 ) == ':80' ) { + $domain = substr( $domain, 0, -3 ); + $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 ); + } else { + die( 'WPMU only works without the port number in the URL.' ); + } } $domain = preg_replace('/:.*$/', '', $domain); // Strip ports if( substr( $domain, -1 ) == '.' ) -- cgit