Skip to content

Commit cd8cbd8

Browse files
authored
[8.x] Add missing port when replacing S3 temporary_url (#36861)
* Add port when replacing s3 temporary_url * Handle nullable port when replacing s3 temporary_url
1 parent 33af825 commit cd8cbd8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Illuminate/Filesystem/FilesystemAdapter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ protected function concatPathToUrl($url, $path)
621621
}
622622

623623
/**
624-
* Replace the scheme and host of the given UriInterface with values from the given URL.
624+
* Replace the scheme, host and port of the given UriInterface with values from the given URL.
625625
*
626626
* @param \Psr\Http\Message\UriInterface $uri
627627
* @param string $url
@@ -631,7 +631,10 @@ protected function replaceBaseUrl($uri, $url)
631631
{
632632
$parsed = parse_url($url);
633633

634-
return $uri->withScheme($parsed['scheme'])->withHost($parsed['host']);
634+
return $uri
635+
->withScheme($parsed['scheme'])
636+
->withHost($parsed['host'])
637+
->withPort($parsed['port'] ?? null);
635638
}
636639

637640
/**

0 commit comments

Comments
 (0)