Skip to content

Commit 65d4b3f

Browse files
Merge branch '5.4' into 6.4
* 5.4: initialize RedisAdapter cursor to 0 do not skip tests from data providers ensure compatibility with Twig 3.15 [Mime] fix encoding issue with UTF-8 addresses containing doubles spaces fix translation file syntax [Validator] [Choice] Fix callback option if not array returned [DependencyInjection] Fix linting factories implemented via __callStatic [DependencyInjection] Fix replacing abstract arguments with bindings Minor fixes around parse_url() checks Ensure compatibility with mongodb v2 Add missing translations for Turkish (tr)
2 parents 708777a + 03cce39 commit 65d4b3f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

AbstractBrowser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,11 @@ public function request(string $method, string $uri, array $parameters = [], arr
353353

354354
$server = array_merge($this->server, $server);
355355

356-
if (!empty($server['HTTP_HOST']) && null === parse_url($originalUri, \PHP_URL_HOST)) {
356+
if (!empty($server['HTTP_HOST']) && !parse_url($originalUri, \PHP_URL_HOST)) {
357357
$uri = preg_replace('{^(https?\://)'.preg_quote($this->extractHost($uri)).'}', '${1}'.$server['HTTP_HOST'], $uri);
358358
}
359359

360-
if (isset($server['HTTPS']) && null === parse_url($originalUri, \PHP_URL_SCHEME)) {
360+
if (isset($server['HTTPS']) && !parse_url($originalUri, \PHP_URL_SCHEME)) {
361361
$uri = preg_replace('{^'.parse_url($uri, \PHP_URL_SCHEME).'}', $server['HTTPS'] ? 'https' : 'http', $uri);
362362
}
363363

Cookie.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static function fromString(string $cookie, ?string $url = null): static
147147
];
148148

149149
if (null !== $url) {
150-
if ((false === $urlParts = parse_url($url)) || !isset($urlParts['host'])) {
150+
if (false === ($urlParts = parse_url($url)) || !isset($urlParts['host'])) {
151151
throw new InvalidArgumentException(sprintf('The URL "%s" is not valid.', $url));
152152
}
153153

@@ -160,7 +160,7 @@ public static function fromString(string $cookie, ?string $url = null): static
160160

161161
if ('secure' === strtolower($part)) {
162162
// Ignore the secure flag if the original URI is not given or is not HTTPS
163-
if (!$url || !isset($urlParts['scheme']) || 'https' !== $urlParts['scheme']) {
163+
if (null === $url || !isset($urlParts['scheme']) || 'https' !== $urlParts['scheme']) {
164164
continue;
165165
}
166166

0 commit comments

Comments
 (0)