1
0
Fork 0

Account for ports in URL

pull/4783/head
Chris Smith 2016-01-22 01:48:16 +00:00
parent 34f1fcbdcb
commit 33f823146b
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ class RemoteFilesystem
$urlHost = parse_url($this->fileUrl, PHP_URL_HOST);
// Replace path using hostname as an anchor.
$targetUrl = preg_replace('{^(.+(?://|@)'.preg_quote($urlHost).')(?:[/\?].*)?$}', '\1'.$locationHeader, $this->fileUrl);
$targetUrl = preg_replace('{^(.+(?://|@)'.preg_quote($urlHost).'(?::\d+)?)(?:[/\?].*)?$}', '\1'.$locationHeader, $this->fileUrl);
} else {
// Relative path; e.g. foo
// This actually differs from PHP which seems to add duplicate slashes.