Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
nicolas-grekas committed Oct 25, 2024
2 parents 708777a + 03cce39 commit 65d4b3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions AbstractBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ public function request(string $method, string $uri, array $parameters = [], arr

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static function fromString(string $cookie, ?string $url = null): static
];

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

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

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

Expand Down

0 comments on commit 65d4b3f

Please sign in to comment.