[phpbbreloaded-checkins] SF.net SVN: phpbbreloaded: [281] main/trunk/install/install.php
Status: Planning
Brought to you by:
tehphpmaster
|
From: <mj...@us...> - 2006-12-30 04:58:08
|
Revision: 281
http://svn.sourceforge.net/phpbbreloaded/?rev=281&view=rev
Author: mjnr
Date: 2006-12-29 20:58:08 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Fixed correct detection of a proxied servers port.
Modified Paths:
--------------
main/trunk/install/install.php
Modified: main/trunk/install/install.php
===================================================================
--- main/trunk/install/install.php 2006-12-30 03:14:20 UTC (rev 280)
+++ main/trunk/install/install.php 2006-12-30 04:58:08 UTC (rev 281)
@@ -449,13 +449,21 @@
}
else
{
- /*
- * TODO:
- * Detect a proxied port (e.g. utilise 'HTTP_X_FORWARDED_HOST:8080' perhaps?)
- * This sounds like a damn ugly hack so need to set up a test server. MJ
- */
- if (!empty($HTTP_SERVER_VARS['SERVER_PORT']) || !empty($HTTP_ENV_VARS['SERVER_PORT']))
+ if (!empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_HOST']) || !empty($HTTP_ENV_VARS['HTTP_X_FORWARDED_HOST']))
{
+ $server_port = (!empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_HOST'])) ? $HTTP_SERVER_VARS['HTTP_X_FORWARDED_HOST'] : $HTTP_ENV_VARS['HTTP_X_FORWARDED_HOST'];
+ $server_port = explode(':',$server_port);
+ if(empty($server_port[1]))
+ {
+ $server_port = '80';
+ }
+ else
+ {
+ $server_port = $server_port[1];
+ }
+ }
+ else if (!empty($HTTP_SERVER_VARS['SERVER_PORT']) || !empty($HTTP_ENV_VARS['SERVER_PORT']))
+ {
$server_port = (!empty($HTTP_SERVER_VARS['SERVER_PORT'])) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $HTTP_ENV_VARS['SERVER_PORT'];
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|