X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWebRequest.php;h=b187c4acef82f1c91d13cb218e86eb775780f860;hb=6b0d5a7b4ecd33833eb9d6e5582395b5b39e7037;hp=4e5fb7a01dc6149f91381af3f2d011c9fabe8f19;hpb=2896cf38d681d4f0f23430b25ab4f1f4f811345c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 4e5fb7a01d..b187c4acef 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -181,7 +181,12 @@ class WebRequest { continue; } $host = $parts[0]; - if ( $parts[1] === false ) { + if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) { + // Bug 70021: Assume that upstream proxy is running on the default + // port based on the protocol. We have no reliable way to determine + // the actual port in use upstream. + $port = $stdPort; + } elseif ( $parts[1] === false ) { if ( isset( $_SERVER['SERVER_PORT'] ) ) { $port = $_SERVER['SERVER_PORT']; } // else leave it as $stdPort @@ -700,7 +705,7 @@ class WebRequest { /** * Take an arbitrary query and rewrite the present URL to include it - * @param string $query query string fragment; do not include initial '?' + * @param string $query Query string fragment; do not include initial '?' * * @return string */ @@ -772,7 +777,7 @@ class WebRequest { * Return the path to the temporary file where PHP has stored the upload. * * @param string $key - * @return string|null string or null if no such file. + * @return string|null String or null if no such file. */ public function getFileTempname( $key ) { $file = new WebRequestUpload( $this, $key ); @@ -799,7 +804,7 @@ class WebRequest { * Other than this the name is not verified for being a safe filename. * * @param string $key - * @return string|null string or null if no such file. + * @return string|null String or null if no such file. */ public function getFileName( $key ) { $file = new WebRequestUpload( $this, $key ); @@ -868,7 +873,7 @@ class WebRequest { /** * Get a request header, or false if it isn't set - * @param string $name case-insensitive header name + * @param string $name Case-insensitive header name * * @return string|bool False on failure */ @@ -969,7 +974,7 @@ HTML; /** * Parse the Accept-Language header sent by the client into an array * - * @return array array( languageCode => q-value ) sorted by q-value in + * @return array Array( languageCode => q-value ) sorted by q-value in * descending order then appearing time in the header in ascending order. * May contain the "language" '*', which applies to languages other than those explicitly listed. * This is aligned with rfc2616 section 14.4 @@ -1252,7 +1257,7 @@ class FauxRequest extends WebRequest { private $session = array(); /** - * @param array $data of *non*-urlencoded key => value pairs, the + * @param array $data Array of *non*-urlencoded key => value pairs, the * fake GET/POST values * @param bool $wasPosted Whether to treat the data as POST * @param array|null $session Session array or null