diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 30408a440624e..6a3604dff7aad 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ | Q | A | ------------- | --- -| Branch? | 6.3 for features / 4.4, 5.4, 6.0, 6.1, or 6.2 for bug fixes +| Branch? | 6.3 for features / 5.4, 6.0, 6.1, or 6.2 for bug fixes | Bug fix? | yes/no | New feature? | yes/no | Deprecations? | yes/no @@ -16,7 +16,7 @@ Additionally (see https://symfony.com/releases): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - - For new features, provide some code snippets to help understand usage. + - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 7ee945d432674..87cd21cf0d442 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -6,7 +6,7 @@ on: schedule: - cron: '34 4 * * 6' push: - branches: [ "6.2" ] + branches: [ "6.3" ] # Declare default permissions as read only. permissions: read-all @@ -23,7 +23,7 @@ jobs: # Needs for private repositories. contents: read actions: read - + steps: - name: "Checkout code" uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 @@ -42,8 +42,8 @@ jobs: # repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} # Publish the results for public repositories to enable scorecard badges. For more details, see - # https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories, `publish_results` will automatically be set to `false`, regardless + # https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories, `publish_results` will automatically be set to `false`, regardless # of the value entered here. publish_results: true @@ -55,7 +55,7 @@ jobs: name: SARIF file path: results.sarif retention-days: 5 - + # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 diff --git a/CHANGELOG-6.0.md b/CHANGELOG-6.0.md index ee6636841aa4a..d0024faa6a47d 100644 --- a/CHANGELOG-6.0.md +++ b/CHANGELOG-6.0.md @@ -7,6 +7,35 @@ in 6.0 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v6.0.0...v6.0.1 +* 6.0.16 (2022-11-28) + + * bug #48333 [Yaml] parse unquoted digits in tag values as integers (xabbuh) + * bug #48330 [FrameworkBundle] do not wire the MercureTransportFactory if the MercureBundle is not enabled (xabbuh) + * bug #48262 [Notifier] [SMSBiuras] `true`/`false` mismatch for `test_mode` option (StaffNowa) + * bug #48273 [HttpKernel] Fix message for unresovable arguments of invokable controllers (fancyweb) + * bug #48251 [PropertyInfo] ignore const expressions read by phpdocumentor (xabbuh) + * bug #48224 [DependencyInjection] Process bindings in `ServiceLocatorTagPass` (MatTheCat) + * bug #48179 [Console] Support completion for bash functions (Chi-teck) + * bug #48217 [Console] Improve error message when shell is not detected in completion command (GromNaN) + * bug #48222 [Translation] [Lokalize] Configure `replace_breaks` to prevent issues with multilines translations (Kocal) + * bug #48210 [Console]  Fix signal handlers called after event listeners and skip exit (GromNaN) + * bug #48198 [Messenger] Fix time-limit check exception (alamirault) + * bug #48122 [PhpUnitBridge] Fix language deprecations incorrectly marked as direct (wouterj) + * bug #47998 [Console] Fix console `ProgressBar::override()` after manual `ProgressBar::cleanup()` (maxbeckers) + * bug #48173 [HttpClient] Handle Amp HTTP client v5 incompatibility gracefully (fancyweb) + * bug #48172 [HttpKernel] Don’t try to wire Response argument with controller.service_arguments (MatTheCat) + * bug #48085 [Messenger] Tell about messenger:consume invalid limit options (MatTheCat) + * bug #48120 [Messenger] Do not throw 'no handlers' exception when skipping handlers due to duplicate handling (wouterj) + * bug #48112 [HttpFoundation] Compare cookie with null value as empty string in ResponseCookieValueSame (fancyweb) + * bug #48119 [FrameworkBundle][Lock] Allow to disable lock without defining a resource (MatTheCat) + * bug #48093 [DependencyInjection] don't move locator tag for service subscriber (RobertMe) + * bug #48075 [Mailer] Stream timeout not detected fgets returns false (Sezil) + * bug #48092 Fix the notification email theme for asynchronously dispatched emails (krisbuist) + * bug #48097 Fix search scope when performing fallback mapping driver detection (spideyfusion) + * bug #48103 [HttpClient] Do not set http_version instead of setting it to null (Tetragramat) + * bug #48027 [DependencyInjection] Don't autoconfigure tag when it's already set with attributes (nicolas-grekas) + * bug #48050 [HttpFoundation] Check IPv6 is valid before comparing it (PhilETaylor) + * 6.0.15 (2022-10-28) * bug #47990 [HttpClient] Fix retrying requests when the content is used by the strategy (nicolas-grekas) diff --git a/CHANGELOG-6.1.md b/CHANGELOG-6.1.md index 4e21e1da8c20b..10ba1bca4466b 100644 --- a/CHANGELOG-6.1.md +++ b/CHANGELOG-6.1.md @@ -7,6 +7,36 @@ in 6.1 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v6.1.0...v6.1.1 +* 6.1.8 (2022-11-28) + + * bug #48333 [Yaml] parse unquoted digits in tag values as integers (xabbuh) + * bug #48330 [FrameworkBundle] do not wire the MercureTransportFactory if the MercureBundle is not enabled (xabbuh) + * bug #48262 [Notifier] [SMSBiuras] `true`/`false` mismatch for `test_mode` option (StaffNowa) + * bug #48273 [HttpKernel] Fix message for unresovable arguments of invokable controllers (fancyweb) + * bug #48251 [PropertyInfo] ignore const expressions read by phpdocumentor (xabbuh) + * bug #48224 [DependencyInjection] Process bindings in `ServiceLocatorTagPass` (MatTheCat) + * bug #48179 [Console] Support completion for bash functions (Chi-teck) + * bug #48217 [Console] Improve error message when shell is not detected in completion command (GromNaN) + * bug #48222 [Translation] [Lokalize] Configure `replace_breaks` to prevent issues with multilines translations (Kocal) + * bug #48210 [Console]  Fix signal handlers called after event listeners and skip exit (GromNaN) + * bug #48198 [Messenger] Fix time-limit check exception (alamirault) + * bug #48122 [PhpUnitBridge] Fix language deprecations incorrectly marked as direct (wouterj) + * bug #47998 [Console] Fix console `ProgressBar::override()` after manual `ProgressBar::cleanup()` (maxbeckers) + * bug #48173 [HttpClient] Handle Amp HTTP client v5 incompatibility gracefully (fancyweb) + * bug #48172 [HttpKernel] Don’t try to wire Response argument with controller.service_arguments (MatTheCat) + * bug #48085 [Messenger] Tell about messenger:consume invalid limit options (MatTheCat) + * bug #48120 [Messenger] Do not throw 'no handlers' exception when skipping handlers due to duplicate handling (wouterj) + * bug #48112 [HttpFoundation] Compare cookie with null value as empty string in ResponseCookieValueSame (fancyweb) + * bug #48119 [FrameworkBundle][Lock] Allow to disable lock without defining a resource (MatTheCat) + * bug #48110 [HttpKernel] Fix deprecation for DateTimeValueResolver with null on non-nullable argument (GromNaN) + * bug #48093 [DependencyInjection] don't move locator tag for service subscriber (RobertMe) + * bug #48075 [Mailer] Stream timeout not detected fgets returns false (Sezil) + * bug #48092 Fix the notification email theme for asynchronously dispatched emails (krisbuist) + * bug #48097 Fix search scope when performing fallback mapping driver detection (spideyfusion) + * bug #48103 [HttpClient] Do not set http_version instead of setting it to null (Tetragramat) + * bug #48027 [DependencyInjection] Don't autoconfigure tag when it's already set with attributes (nicolas-grekas) + * bug #48050 [HttpFoundation] Check IPv6 is valid before comparing it (PhilETaylor) + * 6.1.7 (2022-10-28) * bug #47990 [HttpClient] Fix retrying requests when the content is used by the strategy (nicolas-grekas) diff --git a/CHANGELOG-6.2.md b/CHANGELOG-6.2.md index 14f9052059e73..6e7c970da65a8 100644 --- a/CHANGELOG-6.2.md +++ b/CHANGELOG-6.2.md @@ -7,6 +7,12 @@ in 6.2 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v6.2.0...v6.2.1 +* 6.2.0 (2022-11-30) + + * bug #48395 [String] Fix AsciiSlugger with emojis (fancyweb) + * bug #48385 [Security] Reuse `AbstractFactory`'s config tree in `AccessTokenFactory` (chalasr) + * bug #48292 [Security] [LoginLink] Throw InvalidLoginLinkException on missing parameter (MatTheCat) + * 6.2.0-RC2 (2022-11-28) * bug #48366 [Mailer] Fix body renderer check (fabpot) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 72ef68321528f..b136e74da6266 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -89,6 +89,7 @@ The Symfony Connect username in parenthesis allows to get more information - Eriksen Costa - Florin Patan (florinpatan) - Peter Rehm (rpet) + - Mathieu Lechat (mat_the_cat) - Henrik Bjørnskov (henrikbjorn) - David Buchmann (dbu) - Konstantin Myakshin (koc) @@ -105,6 +106,7 @@ The Symfony Connect username in parenthesis allows to get more information - Issei Murasawa (issei_m) - Fran Moreno (franmomu) - Malte Schlüter (maltemaltesich) + - Antoine Lamirault - Vasilij Dusko - Denis (yethee) - Arnout Boks (aboks) @@ -112,11 +114,9 @@ The Symfony Connect username in parenthesis allows to get more information - Przemysław Bogusz (przemyslaw-bogusz) - Henrik Westphal (snc) - Dariusz Górecki (canni) - - Mathieu Lechat (mat_the_cat) - Maxime Helias (maxhelias) - Ener-Getick - Ruud Kamphuis (ruudk) - - Antoine Lamirault - Sebastiaan Stok (sstok) - Jérôme Vasseur (jvasseur) - Ion Bazan (ionbazan) @@ -159,25 +159,26 @@ The Symfony Connect username in parenthesis allows to get more information - Jesse Rushlow (geeshoe) - Théo FIDRY - jeremyFreeAgent (jeremyfreeagent) + - Jeroen Spee (jeroens) - Michael Babker (mbabker) - Włodzimierz Gajda (gajdaw) - Christian Scheb - Guillaume (guill) - Tugdual Saunier (tucksaun) - Jacob Dreesen (jdreesen) - - Jeroen Spee (jeroens) - Joel Wurtz (brouznouf) - Olivier Dolbeau (odolbeau) - Florian Voutzinos (florianv) - zairig imad (zairigimad) - Colin Frei + - Christopher Hertel (chertel) - Javier Spagnoletti (phansys) - excelwebzone + - Phil Taylor (prazgod) - Jérôme Parmentier (lctrs) - HeahDude - Richard van Laak (rvanlaak) - Paráda József (paradajozsef) - - Christopher Hertel (chertel) - Alessandro Lai (jean85) - Alexander Schwenn (xelaris) - Fabien Pennequin (fabienpennequin) @@ -192,6 +193,7 @@ The Symfony Connect username in parenthesis allows to get more information - Baptiste Leduc (korbeil) - Marco Pivetta (ocramius) - Robert Schönthal (digitalkaoz) + - Hugo Alliaume (kocal) - Võ Xuân Tiến (tienvx) - fd6130 (fdtvui) - Tigran Azatyan (tigranazatyan) @@ -209,13 +211,13 @@ The Symfony Connect username in parenthesis allows to get more information - Jhonny Lidfors (jhonne) - Martin Hujer (martinhujer) - Wouter J + - Chi-teck - Guilliam Xavier - Antonio Pauletich (x-coder264) - Timo Bakx (timobakx) - Juti Noppornpitak (shiroyuki) - Joe Bennett (kralos) - Nate Wiebe (natewiebe13) - - Hugo Alliaume (kocal) - Anthony MARTIN - Colin O'Dell (colinodell) - Sebastian Hörl (blogsh) @@ -227,11 +229,11 @@ The Symfony Connect username in parenthesis allows to get more information - Albert Casademont (acasademont) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) - - Chi-teck - Michael Voříšek - Farhad Safarov (safarov) - SpacePossum - Pablo Godel (pgodel) + - Denis Brumann (dbrumann) - Romaric Drigon (romaricdrigon) - Andréia Bohner (andreia) - Jannik Zschiesche @@ -249,7 +251,6 @@ The Symfony Connect username in parenthesis allows to get more information - Hubert Lenoir (hubert_lenoir) - Florent Mata (fmata) - mcfedr (mcfedr) - - Denis Brumann (dbrumann) - Maciej Malarz (malarzm) - Soner Sayakci - Artem Lopata @@ -288,7 +289,6 @@ The Symfony Connect username in parenthesis allows to get more information - Artur Kotyrba - Tyson Andre - Thomas Landauer (thomas-landauer) - - Phil Taylor (prazgod) - GDIBass - Samuel NELA (snela) - dFayet @@ -543,6 +543,7 @@ The Symfony Connect username in parenthesis allows to get more information - Chris Smith (cs278) - Florian Klein (docteurklein) - Bilge + - Cătălin Dan (dancatalin) - Rhodri Pugh (rodnaph) - Manuel Kiessling (manuelkiessling) - Patrick Reimers (preimers) @@ -570,6 +571,7 @@ The Symfony Connect username in parenthesis allows to get more information - Evert Harmeling (evertharmeling) - Jan Decavele (jandc) - Gustavo Piltcher + - Shakhobiddin - Grenier Kévin (mcsky_biig) - Stepan Tanasiychuk (stfalcon) - Tiago Ribeiro (fixe) @@ -677,6 +679,7 @@ The Symfony Connect username in parenthesis allows to get more information - Tomasz Kusy - Jakub Kucharovic (jkucharovic) - Kristen Gilden + - Oleksiy (alexndlm) - Robbert Klarenbeek (robbertkl) - Eric Masoero (eric-masoero) - Michael Lutz @@ -701,7 +704,6 @@ The Symfony Connect username in parenthesis allows to get more information - ShinDarth - Arun Philip - Stéphane PY (steph_py) - - Cătălin Dan (dancatalin) - Philipp Kräutli (pkraeutli) - Carl Casbolt (carlcasbolt) - battye @@ -770,7 +772,6 @@ The Symfony Connect username in parenthesis allows to get more information - Tomasz Ignatiuk - Joachim Løvgaard (loevgaard) - vladimir.reznichenko - - Shakhobiddin - Kai - Lee Rowlands - Alain Hippolyte (aloneh) @@ -811,6 +812,7 @@ The Symfony Connect username in parenthesis allows to get more information - Rimas Kudelis - Ben Scott (bpscott) - Andrii Dembitskyi + - a.dmitryuk - Pavol Tuka - Paulo Ribeiro (paulo) - Marc Laporte @@ -1014,7 +1016,6 @@ The Symfony Connect username in parenthesis allows to get more information - Elan Ruusamäe (glen) - Brad Jones - Nicolas de Marqué (nicola) - - a.dmitryuk - Jannik Zschiesche - Jan Ole Behrens (deegital) - Mantas Var (mvar) @@ -1188,6 +1189,7 @@ The Symfony Connect username in parenthesis allows to get more information - Timothée BARRAY - Nilmar Sanchez Muguercia - Ivo Bathke (ivoba) + - Lukas Mencl - Strate - Anton A. Sumin - Atthaphon Urairat @@ -1336,7 +1338,6 @@ The Symfony Connect username in parenthesis allows to get more information - Massimiliano Braglia (massimilianobraglia) - Swen van Zanten (swenvanzanten) - Frankie Wittevrongel - - Oleksiy (alexndlm) - Richard Quadling - James Hudson (mrthehud) - Adam Prickett @@ -2069,7 +2070,6 @@ The Symfony Connect username in parenthesis allows to get more information - Pablo Borowicz - Ondřej Frei - Máximo Cuadros (mcuadros) - - Lukas Mencl - EXT - THERAGE Kevin - tamirvs - gauss @@ -2252,6 +2252,7 @@ The Symfony Connect username in parenthesis allows to get more information - Alain Flaus (halundra) - tsufeki - Philipp Strube + - Petar Obradović - Clement Herreman (clemherreman) - Dan Ionut Dumitriu (danionut90) - Evgeny (disparity) @@ -2278,6 +2279,7 @@ The Symfony Connect username in parenthesis allows to get more information - cilefen (cilefen) - Mo Di (modi) - Pablo Schläpfer + - Robert Meijers - Xavier RENAUDIN - Christian Wahler (christian) - Jelte Steijaert (jelte) @@ -2325,6 +2327,7 @@ The Symfony Connect username in parenthesis allows to get more information - Balázs Benyó (duplabe) - Erika Heidi Reinaldo (erikaheidi) - Marc J. Schmidt (marcjs) + - Maximilian Beckers (maxbeckers) - Sebastian Schwarz - karolsojko - Marco Jantke @@ -2631,6 +2634,7 @@ The Symfony Connect username in parenthesis allows to get more information - Bert Hekman - Luis Muñoz - Matthew Donadio + - Kris Buist - Houziaux mike - Phobetor - Markus @@ -2728,6 +2732,7 @@ The Symfony Connect username in parenthesis allows to get more information - Rénald Casagraude (rcasagraude) - Robin Duval (robin-duval) - Mohammad Ali Sarbanha (sarbanha) + - Steeve Titeca (stiteca) - Artem Lopata (bumz) - alex - Roman Orlov @@ -2825,6 +2830,7 @@ The Symfony Connect username in parenthesis allows to get more information - pf - Zoli Konta - Vincent Chalnot + - Roeland Jago Douma - Patrizio Bekerle - Tom Maguire - Mateusz Lerczak @@ -2849,6 +2855,7 @@ The Symfony Connect username in parenthesis allows to get more information - Omar Yepez (oyepez003) - Jonny Schmid (schmidjon) - Götz Gottwald + - Christoph Krapp - Nick Chiu - Robert Campbell - Matt Lehner @@ -3009,6 +3016,7 @@ The Symfony Connect username in parenthesis allows to get more information - Mantas Urnieža - temperatur - Paul Andrieux + - Sezil - Cas - ghazy ben ahmed - Karolis @@ -3076,6 +3084,7 @@ The Symfony Connect username in parenthesis allows to get more information - Markus Tacker - Kasperki - Tammy D + - Adrien Foulon - Ryan Rud - Ondrej Slinták - vlechemin @@ -3122,6 +3131,7 @@ The Symfony Connect username in parenthesis allows to get more information - zorn - Yuriy Potemkin - Emilie Lorenzo + - prudhomme victor - enomotodev - Vincent - Benjamin Long @@ -3166,6 +3176,7 @@ The Symfony Connect username in parenthesis allows to get more information - Lin Lu - arduanov - sualko + - Fabien - Martin Komischke - ADmad - Nicolas Roudaire diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AccessTokenFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AccessTokenFactory.php index b59f7974f1e87..2fbf3b2f8b567 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AccessTokenFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AccessTokenFactory.php @@ -36,14 +36,12 @@ public function __construct() public function addConfiguration(NodeDefinition $node): void { - $builder = $node->children(); + parent::addConfiguration($node); + $builder = $node->children(); $builder ->scalarNode('token_handler')->isRequired()->end() - ->scalarNode('user_provider')->defaultNull()->end() ->scalarNode('realm')->defaultNull()->end() - ->scalarNode('success_handler')->defaultNull()->end() - ->scalarNode('failure_handler')->defaultNull()->end() ->arrayNode('token_extractors') ->fixXmlConfig('token_extractors') ->beforeNormalization() @@ -71,7 +69,6 @@ public function getKey(): string public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string { - $userProvider = new Reference($config['user_provider'] ?? $userProviderId); $successHandler = isset($config['success_handler']) ? new Reference($this->createAuthenticationSuccessHandler($container, $firewallName, $config)) : null; $failureHandler = isset($config['failure_handler']) ? new Reference($this->createAuthenticationFailureHandler($container, $firewallName, $config)) : null; $authenticatorId = sprintf('security.authenticator.access_token.%s', $firewallName); @@ -81,7 +78,7 @@ public function createAuthenticator(ContainerBuilder $container, string $firewal ->setDefinition($authenticatorId, new ChildDefinition('security.authenticator.access_token')) ->replaceArgument(0, new Reference($config['token_handler'])) ->replaceArgument(1, new Reference($extractorId)) - ->replaceArgument(2, $userProvider) + ->replaceArgument(2, new Reference($userProviderId)) ->replaceArgument(3, $successHandler) ->replaceArgument(4, $failureHandler) ->replaceArgument(5, $config['realm']) diff --git a/src/Symfony/Component/Console/Output/OutputInterface.php b/src/Symfony/Component/Console/Output/OutputInterface.php index 33cd18f0c2631..bc927c51e9d26 100644 --- a/src/Symfony/Component/Console/Output/OutputInterface.php +++ b/src/Symfony/Component/Console/Output/OutputInterface.php @@ -33,17 +33,17 @@ interface OutputInterface /** * Writes a message to the output. * - * @param bool $newline Whether to add a newline - * @param self::VERBOSITY_*|self::OUTPUT_* $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), - * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * @param bool $newline Whether to add a newline + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), + * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ public function write(string|iterable $messages, bool $newline = false, int $options = 0); /** * Writes a message to the output and adds a newline at the end. * - * @param self::VERBOSITY_*|self::OUTPUT_* $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), - * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), + * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ public function writeln(string|iterable $messages, int $options = 0); diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 1603af6aa1ec8..5db0cf505e49d 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -75,12 +75,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.2.0-RC2'; + public const VERSION = '6.2.0'; public const VERSION_ID = 60200; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 2; public const RELEASE_VERSION = 0; - public const EXTRA_VERSION = 'RC2'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '07/2023'; public const END_OF_LIFE = '07/2023'; diff --git a/src/Symfony/Component/Notifier/Bridge/AmazonSns/README.md b/src/Symfony/Component/Notifier/Bridge/AmazonSns/README.md index 3c32a8eef1d00..3dbcbb1546247 100644 --- a/src/Symfony/Component/Notifier/Bridge/AmazonSns/README.md +++ b/src/Symfony/Component/Notifier/Bridge/AmazonSns/README.md @@ -13,7 +13,7 @@ AMAZON_SNS_DSN=sns://ACCESS_ID:ACCESS_KEY@default?region=REGION Resources --------- - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/src/Symfony/Component/Notifier/Bridge/Chatwork/README.md b/src/Symfony/Component/Notifier/Bridge/Chatwork/README.md index 6c61e1565a0d9..c0b5dc42e6faf 100644 --- a/src/Symfony/Component/Notifier/Bridge/Chatwork/README.md +++ b/src/Symfony/Component/Notifier/Bridge/Chatwork/README.md @@ -13,7 +13,7 @@ CHATWORK_DSN=chatwork://API_TOKEN@default?room_id=ID Resources --------- - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/src/Symfony/Component/Notifier/Bridge/Sendberry/README.md b/src/Symfony/Component/Notifier/Bridge/Sendberry/README.md index 5dc8b646bf485..c4585cb5dd90d 100644 --- a/src/Symfony/Component/Notifier/Bridge/Sendberry/README.md +++ b/src/Symfony/Component/Notifier/Bridge/Sendberry/README.md @@ -19,7 +19,7 @@ where: Resources --------- - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/src/Symfony/Component/Notifier/Bridge/Telnyx/README.md b/src/Symfony/Component/Notifier/Bridge/Telnyx/README.md index e279e11167a35..36d1aa7a21efd 100644 --- a/src/Symfony/Component/Notifier/Bridge/Telnyx/README.md +++ b/src/Symfony/Component/Notifier/Bridge/Telnyx/README.md @@ -18,7 +18,7 @@ where: Resources --------- - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/src/Symfony/Component/Security/Http/Authentication/AuthenticationSuccessHandlerInterface.php b/src/Symfony/Component/Security/Http/Authentication/AuthenticationSuccessHandlerInterface.php index 8dad2b01eafc4..690234e710ba6 100644 --- a/src/Symfony/Component/Security/Http/Authentication/AuthenticationSuccessHandlerInterface.php +++ b/src/Symfony/Component/Security/Http/Authentication/AuthenticationSuccessHandlerInterface.php @@ -27,9 +27,7 @@ interface AuthenticationSuccessHandlerInterface { /** - * This is called when an interactive authentication attempt succeeds. This - * is called by authentication listeners inheriting from - * AbstractAuthenticationListener. + * Usually called by AuthenticatorInterface::onAuthenticationSuccess() implementations. */ public function onAuthenticationSuccess(Request $request, TokenInterface $token): Response; } diff --git a/src/Symfony/Component/Security/Http/LoginLink/LoginLinkHandler.php b/src/Symfony/Component/Security/Http/LoginLink/LoginLinkHandler.php index 39df489f88dd4..711302cdc55da 100644 --- a/src/Symfony/Component/Security/Http/LoginLink/LoginLinkHandler.php +++ b/src/Symfony/Component/Security/Http/LoginLink/LoginLinkHandler.php @@ -89,8 +89,12 @@ public function consumeLoginLink(Request $request): UserInterface throw new InvalidLoginLinkException('User not found.', 0, $exception); } - $hash = $request->get('hash'); - $expires = $request->get('expires'); + if (!$hash = $request->get('hash')) { + throw new InvalidLoginLinkException('Missing "hash" parameter.'); + } + if (!$expires = $request->get('expires')) { + throw new InvalidLoginLinkException('Missing "expires" parameter.'); + } try { $this->signatureHasher->verifySignatureHash($user, $expires, $hash); diff --git a/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php b/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php index 83e4966d6bcda..52aaf89faea2e 100644 --- a/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php @@ -214,6 +214,30 @@ public function testConsumeLoginLinkExceedsMaxUsage() $linker->consumeLoginLink($request); } + public function testConsumeLoginLinkWithMissingHash() + { + $user = new TestLoginLinkHandlerUser('weaverryan', 'ryan@symfonycasts.com', 'pwhash'); + $this->userProvider->createUser($user); + + $this->expectException(InvalidLoginLinkException::class); + $request = Request::create('/login/verify?user=weaverryan&expires=10000'); + + $linker = $this->createLinker(); + $linker->consumeLoginLink($request); + } + + public function testConsumeLoginLinkWithMissingExpiration() + { + $user = new TestLoginLinkHandlerUser('weaverryan', 'ryan@symfonycasts.com', 'pwhash'); + $this->userProvider->createUser($user); + + $this->expectException(InvalidLoginLinkException::class); + $request = Request::create('/login/verify?user=weaverryan&hash=thehash'); + + $linker = $this->createLinker(); + $linker->consumeLoginLink($request); + } + private function createSignatureHash(string $username, int $expires, array $extraFields): string { $fields = [base64_encode($username), $expires]; diff --git a/src/Symfony/Component/String/Slugger/AsciiSlugger.php b/src/Symfony/Component/String/Slugger/AsciiSlugger.php index f4b44d3ac432b..826d07ca09e0c 100644 --- a/src/Symfony/Component/String/Slugger/AsciiSlugger.php +++ b/src/Symfony/Component/String/Slugger/AsciiSlugger.php @@ -113,10 +113,8 @@ public function slug(string $string, string $separator = '-', string $locale = n $transliterator = (array) $this->createTransliterator($locale); } - if (\is_string($this->emoji)) { - $transliterator[] = EmojiTransliterator::create("emoji-{$this->emoji}"); - } elseif ($this->emoji && null !== $locale) { - $transliterator[] = EmojiTransliterator::create("emoji-{$locale}"); + if ($emojiTransliterator = $this->createEmojiTransliterator($locale)) { + $transliterator[] = $emojiTransliterator; } if ($this->symbolsMap instanceof \Closure) { @@ -177,6 +175,25 @@ private function createTransliterator(string $locale): ?\Transliterator return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; } + private function createEmojiTransliterator(?string $locale): ?EmojiTransliterator + { + if (\is_string($this->emoji)) { + $locale = $this->emoji; + } elseif (!$this->emoji) { + return null; + } + + while (null !== $locale) { + try { + return EmojiTransliterator::create("emoji-$locale"); + } catch (\IntlException) { + $locale = self::getParentLocale($locale); + } + } + + return null; + } + private static function getParentLocale(?string $locale): ?string { if (!$locale) { diff --git a/src/Symfony/Component/String/Tests/Slugger/AsciiSluggerTest.php b/src/Symfony/Component/String/Tests/Slugger/AsciiSluggerTest.php index 37eba92b60e14..163be0e7cadf3 100644 --- a/src/Symfony/Component/String/Tests/Slugger/AsciiSluggerTest.php +++ b/src/Symfony/Component/String/Tests/Slugger/AsciiSluggerTest.php @@ -49,6 +49,7 @@ public function provideSlugTests(): iterable /** * @dataProvider provideSlugEmojiTests + * * @requires extension intl */ public function testSlugEmoji(string $expected, string $string, ?string $locale, string|bool $emoji = true) @@ -94,5 +95,15 @@ public function provideSlugEmojiTests(): iterable 'en', 'github', ]; + yield [ + 'un-chat-qui-sourit-chat-noir-et-un-tete-de-lion-vont-au-parc-national', + 'un 😺, 🐈‍⬛, et un 🦁 vont au 🏞️', + 'fr_XX', // Fallback on parent locale + ]; + yield [ + 'un-et-un-vont-au', + 'un 😺, 🐈‍⬛, et un 🦁 vont au 🏞️', + 'undefined_locale', // Behaves the same as if emoji support is disabled + ]; } }