Unverified Commit 0c7a62ad authored by larowlan's avatar larowlan

Revert "Issue #3174349 by quietone, itaran, dww, Kristen Pol:...

Revert "Issue #3174349 by quietone, itaran, dww, Kristen Pol: file_url_transform_relative() cannot handle URLs where the port is different from the site's request port"

This reverts commit 9a4f58da.
parent 9a4f58da
......@@ -125,13 +125,6 @@ function file_url_transform_relative($file_url) {
$host = $request->getHost();
$scheme = $request->getScheme();
$port = $request->getPort() ?: 80;
// Files may be accessible on a different port than the web request.
$file_url_port = parse_url($file_url, PHP_URL_PORT) ?? $port;
if ($file_url_port != $port) {
return $file_url;
}
if (('http' == $scheme && $port == 80) || ('https' == $scheme && $port == 443)) {
$http_host = $host;
}
......
......@@ -41,56 +41,41 @@ public function testFileUrlTransformRelative($host, $port, $https, $url, $expect
}
public function providerFileUrlTransformRelative() {
$data = [
'http' => [
'example.com',
80,
'',
'http://example.com/page',
'/page',
],
'https' => [
'example.com',
443,
'on',
'https://example.com/page',
'/page',
],
'http 8080' => [
'example.com',
8080,
'',
'https://example.com:8080/page',
'/page',
],
'https 8443' => [
'example.com',
8443,
'on',
'https://example.com:8443/page',
'/page',
],
'http no dot' => [
'example.com',
80,
'',
'http://exampleXcom/page',
'http://exampleXcom/page',
],
'http files on different port than the web request' => [
'example.com',
80,
'',
'http://example.com:9000/page',
'http://example.com:9000/page',
],
'https files on different port than the web request' => [
'example.com',
443,
'on',
'https://example.com:8443/page',
'https://example.com:8443/page',
],
$data = [];
$data[] = [
'example.com',
80,
'',
'http://example.com/page',
'/page',
];
$data[] = [
'example.com',
443,
'on',
'https://example.com/page',
'/page',
];
$data[] = [
'example.com',
8080,
'',
'https://example.com:8080/page',
'/page',
];
$data[] = [
'example.com',
8443,
'on',
'https://example.com:8443/page',
'/page',
];
$data[] = [
'example.com',
80,
'',
'http://exampleXcom/page',
'http://exampleXcom/page',
];
return $data;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment