Merge "Remove $wgGoToEdit functionality"
[lhc/web/wiklou.git] / includes / WebRequest.php
index a1fa0eb..1cbdbf9 100644 (file)
@@ -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
@@ -1250,6 +1255,7 @@ class WebRequestUpload {
 class FauxRequest extends WebRequest {
        private $wasPosted = false;
        private $session = array();
+       private $requestUrl;
 
        /**
         * @param array $data Array of *non*-urlencoded key => value pairs, the
@@ -1329,8 +1335,15 @@ class FauxRequest extends WebRequest {
                return false;
        }
 
+       public function setRequestURL( $url ) {
+               $this->requestUrl = $url;
+       }
+
        public function getRequestURL() {
-               $this->notImplemented( __METHOD__ );
+               if ( $this->requestUrl === null ) {
+                       throw new MWException( 'Request URL not set' );
+               }
+               return $this->requestUrl;
        }
 
        public function getProtocol() {