diff --git a/composer.json b/composer.json index 497e69c1e..dfd7b4ff6 100644 --- a/composer.json +++ b/composer.json @@ -52,12 +52,12 @@ "stecman/symfony-console-completion": "^0.13.0", "symfony/console": "^6.4.17", "symfony/event-dispatcher": "^6.4.13", - "symfony/http-foundation": "^6.4.16", + "symfony/http-foundation": "^6.4.18", "symfony/mailer": "^6.4", "symfony/polyfill-intl-grapheme": "^1.31.0", "symfony/polyfill-intl-normalizer": "^1.31.0", "symfony/process": "^6.4.15", - "symfony/routing": "^6.4.16", + "symfony/routing": "^6.4.18", "symfony/translation": "^6.4.13", "wapmorgan/mp3info": "^0.1.0", "web-auth/webauthn-lib": "^4.9.1" diff --git a/composer.lock b/composer.lock index f438711aa..99f15039c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b19a7af2d8e01cd5d41d5d1ba2e256ca", + "content-hash": "001f28d387eb9af870ae008602a482c1", "packages": [ { "name": "aws/aws-crt-php", @@ -4691,16 +4691,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.16", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57" + "reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/431771b7a6f662f1575b3cfc8fd7617aa9864d57", - "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0492d6217e5ab48f51fca76f64cf8e78919d0db", + "reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db", "shasum": "" }, "require": { @@ -4748,7 +4748,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.16" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.18" }, "funding": [ { @@ -4764,20 +4764,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T18:58:10+00:00" + "time": "2025-01-09T15:48:56+00:00" }, { "name": "symfony/mailer", - "version": "v6.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "c2f7e0d8d7ac8fe25faccf5d8cac462805db2663" + "reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/c2f7e0d8d7ac8fe25faccf5d8cac462805db2663", - "reference": "c2f7e0d8d7ac8fe25faccf5d8cac462805db2663", + "url": "https://api.github.com/repos/symfony/mailer/zipball/e93a6ae2767d7f7578c2b7961d9d8e27580b2b11", + "reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11", "shasum": "" }, "require": { @@ -4828,7 +4828,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.4.13" + "source": "https://github.com/symfony/mailer/tree/v6.4.18" }, "funding": [ { @@ -4844,20 +4844,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2025-01-24T15:27:15+00:00" }, { "name": "symfony/mime", - "version": "v6.4.17", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232" + "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", - "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", + "url": "https://api.github.com/repos/symfony/mime/zipball/917d77981eb1ea963608d5cda4d9c0cf72eaa68e", + "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e", "shasum": "" }, "require": { @@ -4913,7 +4913,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.4.17" + "source": "https://github.com/symfony/mime/tree/v6.4.18" }, "funding": [ { @@ -4929,7 +4929,7 @@ "type": "tidelift" } ], - "time": "2024-12-02T11:09:41+00:00" + "time": "2025-01-23T13:10:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5630,16 +5630,16 @@ }, { "name": "symfony/routing", - "version": "v6.4.16", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220" + "reference": "e9bfc94953019089acdfb9be51c1b9142c4afa68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/91e02e606b4b705c2f4fb42f7e7708b7923a3220", - "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220", + "url": "https://api.github.com/repos/symfony/routing/zipball/e9bfc94953019089acdfb9be51c1b9142c4afa68", + "reference": "e9bfc94953019089acdfb9be51c1b9142c4afa68", "shasum": "" }, "require": { @@ -5693,7 +5693,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.16" + "source": "https://github.com/symfony/routing/tree/v6.4.18" }, "funding": [ { @@ -5709,7 +5709,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T15:31:34+00:00" + "time": "2025-01-09T08:51:02+00:00" }, { "name": "symfony/service-contracts", diff --git a/composer/installed.json b/composer/installed.json index c449b0c26..0c04142a0 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -4892,17 +4892,17 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.16", - "version_normalized": "6.4.16.0", + "version": "v6.4.18", + "version_normalized": "6.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57" + "reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/431771b7a6f662f1575b3cfc8fd7617aa9864d57", - "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0492d6217e5ab48f51fca76f64cf8e78919d0db", + "reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db", "shasum": "" }, "require": { @@ -4924,7 +4924,7 @@ "symfony/mime": "^5.4|^6.0|^7.0", "symfony/rate-limiter": "^5.4|^6.0|^7.0" }, - "time": "2024-11-13T18:58:10+00:00", + "time": "2025-01-09T15:48:56+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4952,7 +4952,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.16" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.18" }, "funding": [ { @@ -4972,17 +4972,17 @@ }, { "name": "symfony/mailer", - "version": "v6.4.13", - "version_normalized": "6.4.13.0", + "version": "v6.4.18", + "version_normalized": "6.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "c2f7e0d8d7ac8fe25faccf5d8cac462805db2663" + "reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/c2f7e0d8d7ac8fe25faccf5d8cac462805db2663", - "reference": "c2f7e0d8d7ac8fe25faccf5d8cac462805db2663", + "url": "https://api.github.com/repos/symfony/mailer/zipball/e93a6ae2767d7f7578c2b7961d9d8e27580b2b11", + "reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11", "shasum": "" }, "require": { @@ -5007,7 +5007,7 @@ "symfony/messenger": "^6.2|^7.0", "symfony/twig-bridge": "^6.2|^7.0" }, - "time": "2024-09-25T14:18:03+00:00", + "time": "2025-01-24T15:27:15+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5035,7 +5035,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.4.13" + "source": "https://github.com/symfony/mailer/tree/v6.4.18" }, "funding": [ { @@ -5055,17 +5055,17 @@ }, { "name": "symfony/mime", - "version": "v6.4.17", - "version_normalized": "6.4.17.0", + "version": "v6.4.18", + "version_normalized": "6.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232" + "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", - "reference": "ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232", + "url": "https://api.github.com/repos/symfony/mime/zipball/917d77981eb1ea963608d5cda4d9c0cf72eaa68e", + "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e", "shasum": "" }, "require": { @@ -5091,7 +5091,7 @@ "symfony/property-info": "^5.4|^6.0|^7.0", "symfony/serializer": "^6.4.3|^7.0.3" }, - "time": "2024-12-02T11:09:41+00:00", + "time": "2025-01-23T13:10:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5123,7 +5123,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.4.17" + "source": "https://github.com/symfony/mime/tree/v6.4.18" }, "funding": [ { @@ -5867,17 +5867,17 @@ }, { "name": "symfony/routing", - "version": "v6.4.16", - "version_normalized": "6.4.16.0", + "version": "v6.4.18", + "version_normalized": "6.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220" + "reference": "e9bfc94953019089acdfb9be51c1b9142c4afa68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/91e02e606b4b705c2f4fb42f7e7708b7923a3220", - "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220", + "url": "https://api.github.com/repos/symfony/routing/zipball/e9bfc94953019089acdfb9be51c1b9142c4afa68", + "reference": "e9bfc94953019089acdfb9be51c1b9142c4afa68", "shasum": "" }, "require": { @@ -5899,7 +5899,7 @@ "symfony/http-foundation": "^5.4|^6.0|^7.0", "symfony/yaml": "^5.4|^6.0|^7.0" }, - "time": "2024-11-13T15:31:34+00:00", + "time": "2025-01-09T08:51:02+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5933,7 +5933,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.16" + "source": "https://github.com/symfony/routing/tree/v6.4.18" }, "funding": [ { diff --git a/composer/installed.php b/composer/installed.php index 5f6ca3650..e6df5386c 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -713,27 +713,27 @@ ), ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v6.4.16', - 'version' => '6.4.16.0', - 'reference' => '431771b7a6f662f1575b3cfc8fd7617aa9864d57', + 'pretty_version' => 'v6.4.18', + 'version' => '6.4.18.0', + 'reference' => 'd0492d6217e5ab48f51fca76f64cf8e78919d0db', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/mailer' => array( - 'pretty_version' => 'v6.4.13', - 'version' => '6.4.13.0', - 'reference' => 'c2f7e0d8d7ac8fe25faccf5d8cac462805db2663', + 'pretty_version' => 'v6.4.18', + 'version' => '6.4.18.0', + 'reference' => 'e93a6ae2767d7f7578c2b7961d9d8e27580b2b11', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/mailer', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/mime' => array( - 'pretty_version' => 'v6.4.17', - 'version' => '6.4.17.0', - 'reference' => 'ea87c8850a54ff039d3e0ab4ae5586dd4e6c0232', + 'pretty_version' => 'v6.4.18', + 'version' => '6.4.18.0', + 'reference' => '917d77981eb1ea963608d5cda4d9c0cf72eaa68e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/mime', 'aliases' => array(), @@ -821,9 +821,9 @@ 'dev_requirement' => false, ), 'symfony/routing' => array( - 'pretty_version' => 'v6.4.16', - 'version' => '6.4.16.0', - 'reference' => '91e02e606b4b705c2f4fb42f7e7708b7923a3220', + 'pretty_version' => 'v6.4.18', + 'version' => '6.4.18.0', + 'reference' => 'e9bfc94953019089acdfb9be51c1b9142c4afa68', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/routing', 'aliases' => array(), diff --git a/symfony/http-foundation/IpUtils.php b/symfony/http-foundation/IpUtils.php index ceab620c2..18b1c5faf 100644 --- a/symfony/http-foundation/IpUtils.php +++ b/symfony/http-foundation/IpUtils.php @@ -182,6 +182,16 @@ public static function checkIp6(string $requestIp, string $ip): bool */ public static function anonymize(string $ip): string { + /** + * If the IP contains a % symbol, then it is a local-link address with scoping according to RFC 4007 + * In that case, we only care about the part before the % symbol, as the following functions, can only work with + * the IP address itself. As the scope can leak information (containing interface name), we do not want to + * include it in our anonymized IP data. + */ + if (str_contains($ip, '%')) { + $ip = substr($ip, 0, strpos($ip, '%')); + } + $wrappedIPv6 = false; if (str_starts_with($ip, '[') && str_ends_with($ip, ']')) { $wrappedIPv6 = true; diff --git a/symfony/http-foundation/RequestStack.php b/symfony/http-foundation/RequestStack.php index 5aa8ba793..ca61eef29 100644 --- a/symfony/http-foundation/RequestStack.php +++ b/symfony/http-foundation/RequestStack.php @@ -106,4 +106,11 @@ public function getSession(): SessionInterface throw new SessionNotFoundException(); } + + public function resetRequestFormats(): void + { + static $resetRequestFormats; + $resetRequestFormats ??= \Closure::bind(static fn () => self::$formats = null, null, Request::class); + $resetRequestFormats(); + } } diff --git a/symfony/mailer/Transport/SendmailTransport.php b/symfony/mailer/Transport/SendmailTransport.php index 3add460eb..774c0e563 100644 --- a/symfony/mailer/Transport/SendmailTransport.php +++ b/symfony/mailer/Transport/SendmailTransport.php @@ -114,7 +114,7 @@ protected function doSend(SentMessage $message): void $this->stream->setCommand($command); $this->stream->initialize(); foreach ($chunks as $chunk) { - $this->stream->write($chunk); + $this->stream->write($chunk, false); } $this->stream->flush(); $this->stream->terminate(); diff --git a/symfony/mailer/Transport/Smtp/SmtpTransport.php b/symfony/mailer/Transport/Smtp/SmtpTransport.php index 0de38fb2e..7de2f91cb 100644 --- a/symfony/mailer/Transport/Smtp/SmtpTransport.php +++ b/symfony/mailer/Transport/Smtp/SmtpTransport.php @@ -205,11 +205,11 @@ protected function doSend(SentMessage $message): void $this->ping(); } - if (!$this->started) { - $this->start(); - } - try { + if (!$this->started) { + $this->start(); + } + $envelope = $message->getEnvelope(); $this->doMailFromCommand($envelope->getSender()->getEncodedAddress()); foreach ($envelope->getRecipients() as $recipient) { diff --git a/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php b/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php index 498dc560c..55a2594ac 100644 --- a/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php +++ b/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php @@ -80,11 +80,10 @@ public function readLine(): string $line = @fgets($this->out); if ('' === $line || false === $line) { - $metas = stream_get_meta_data($this->out); - if ($metas['timed_out']) { + if (stream_get_meta_data($this->out)['timed_out']) { throw new TransportException(sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription())); } - if ($metas['eof']) { + if (feof($this->out)) { // don't use "eof" metadata, it's not accurate on Windows throw new TransportException(sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription())); } if (false === $line) { diff --git a/symfony/mime/Email.php b/symfony/mime/Email.php index 346618cf2..797e0028f 100644 --- a/symfony/mime/Email.php +++ b/symfony/mime/Email.php @@ -416,7 +416,7 @@ public function ensureValidity() private function ensureBodyValid(): void { - if (null === $this->text && null === $this->html && !$this->attachments) { + if (null === $this->text && null === $this->html && !$this->attachments && null === parent::getBody()) { throw new LogicException('A message must have a text or an HTML part or attachments.'); } } diff --git a/symfony/routing/Loader/Configurator/RouteConfigurator.php b/symfony/routing/Loader/Configurator/RouteConfigurator.php index d9d441da1..26a2e3857 100644 --- a/symfony/routing/Loader/Configurator/RouteConfigurator.php +++ b/symfony/routing/Loader/Configurator/RouteConfigurator.php @@ -42,7 +42,14 @@ public function __construct(RouteCollection $collection, RouteCollection $route, */ final public function host(string|array $host): static { + $previousRoutes = clone $this->route; $this->addHost($this->route, $host); + foreach ($previousRoutes as $name => $route) { + if (!$this->route->get($name)) { + $this->collection->remove($name); + } + } + $this->collection->addCollection($this->route); return $this; } diff --git a/symfony/routing/Loader/XmlFileLoader.php b/symfony/routing/Loader/XmlFileLoader.php index 2518161ae..1e3e3283d 100644 --- a/symfony/routing/Loader/XmlFileLoader.php +++ b/symfony/routing/Loader/XmlFileLoader.php @@ -135,7 +135,7 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, st throw new \InvalidArgumentException(sprintf('The element in file "%s" must not have both a "path" attribute and child nodes.', $path)); } - $routes = $this->createLocalizedRoute($collection, $id, $paths ?: $node->getAttribute('path')); + $routes = $this->createLocalizedRoute(new RouteCollection(), $id, $paths ?: $node->getAttribute('path')); $routes->addDefaults($defaults); $routes->addRequirements($requirements); $routes->addOptions($options); @@ -146,6 +146,8 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, st if (null !== $hosts) { $this->addHost($routes, $hosts); } + + $collection->addCollection($routes); } /** diff --git a/symfony/routing/Loader/YamlFileLoader.php b/symfony/routing/Loader/YamlFileLoader.php index 9605e9a87..09beb7cd5 100644 --- a/symfony/routing/Loader/YamlFileLoader.php +++ b/symfony/routing/Loader/YamlFileLoader.php @@ -157,7 +157,7 @@ protected function parseRoute(RouteCollection $collection, string $name, array $ $defaults['_stateless'] = $config['stateless']; } - $routes = $this->createLocalizedRoute($collection, $name, $config['path']); + $routes = $this->createLocalizedRoute(new RouteCollection(), $name, $config['path']); $routes->addDefaults($defaults); $routes->addRequirements($requirements); $routes->addOptions($options); @@ -168,6 +168,8 @@ protected function parseRoute(RouteCollection $collection, string $name, array $ if (isset($config['host'])) { $this->addHost($routes, $config['host']); } + + $collection->addCollection($routes); } /**