Merge "Show a warning in edit preview when a template loop is detected"
[lhc/web/wiklou.git] / includes / http / MWHttpRequest.php
index 8d58ce5..0f0118c 100644 (file)
@@ -33,8 +33,12 @@ use Psr\Log\NullLogger;
 class MWHttpRequest implements LoggerAwareInterface {
        const SUPPORTS_FILE_POSTS = false;
 
-       protected $content;
+       /**
+        * @var int|string
+        */
        protected $timeout = 'default';
+
+       protected $content;
        protected $headersOnly = null;
        protected $postData = null;
        protected $proxy = null;
@@ -609,19 +613,17 @@ class MWHttpRequest implements LoggerAwareInterface {
                                }
                        }
 
-                       if ( $foundRelativeURI ) {
-                               if ( $domain ) {
-                                       return $domain . $locations[$countLocations - 1];
-                               } else {
-                                       $url = parse_url( $this->url );
-                                       if ( isset( $url['host'] ) ) {
-                                               return $url['scheme'] . '://' . $url['host'] .
-                                                       $locations[$countLocations - 1];
-                                       }
-                               }
-                       } else {
+                       if ( !$foundRelativeURI ) {
                                return $locations[$countLocations - 1];
                        }
+                       if ( $domain ) {
+                               return $domain . $locations[$countLocations - 1];
+                       }
+                       $url = parse_url( $this->url );
+                       if ( isset( $url['host'] ) ) {
+                               return $url['scheme'] . '://' . $url['host'] .
+                                       $locations[$countLocations - 1];
+                       }
                }
 
                return $this->url;