diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml
index b6015edf4e00c..40c0e66c573ea 100644
--- a/.github/workflows/package-tests.yml
+++ b/.github/workflows/package-tests.yml
@@ -21,7 +21,7 @@ jobs:
- name: Find packages
id: find-packages
- run: echo "::set-output name=packages::$(php .github/get-modified-packages.php $(find src/Symfony -mindepth 2 -type f -name composer.json -printf '%h\n' | jq -R -s -c 'split("\n")[:-1]') $(git diff --name-only origin/${{ github.base_ref }} HEAD | grep src/ | jq -R -s -c 'split("\n")[:-1]'))"
+ run: echo "::set-output name=packages::$(php .github/get-modified-packages.php $(find src/Symfony -mindepth 2 -maxdepth 6 -type f -name composer.json -printf '%h\n' | jq -R -s -c 'split("\n")[:-1]') $(git diff --name-only origin/${{ github.base_ref }} HEAD | grep src/ | jq -R -s -c 'split("\n")[:-1]'))"
- name: Verify meta files are correct
run: |
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index b6ef19b0ee8bb..6acf7574c9f25 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -43,11 +43,6 @@ jobs:
with:
fetch-depth: 2
- - name: Configure for PHP >= 8.2
- if: "matrix.php >= '8.2'"
- run: |
- composer config platform.php 8.1.99
-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
@@ -69,7 +64,7 @@ jobs:
echo COLUMNS=120 >> $GITHUB_ENV
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty,benchmark,intl-data,integration" >> $GITHUB_ENV
- echo COMPOSER_UP='composer update --no-progress --ansi' >> $GITHUB_ENV
+ echo COMPOSER_UP='composer update --no-progress --ansi'$([[ "${{ matrix.php }}" = "8.2" ]] && echo ' --ignore-platform-req=php+') >> $GITHUB_ENV
SYMFONY_VERSIONS=$(git ls-remote -q --heads | cut -f2 | grep -o '/[1-9][0-9]*\.[0-9].*' | sort -V)
SYMFONY_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | cut -d "'" -f2 | cut -d '.' -f 1-2)
@@ -98,7 +93,7 @@ jobs:
echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV
cp composer.json composer.json.orig
echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json
- php .github/build-packages.php HEAD^ $SYMFONY_VERSION $(find src/Symfony -mindepth 2 -type f -name composer.json -printf '%h\n')
+ php .github/build-packages.php HEAD^ $SYMFONY_VERSION $(find src/Symfony -mindepth 2 -maxdepth 6 -type f -name composer.json -printf '%h\n')
mv composer.json composer.json.phpunit
mv composer.json.orig composer.json
fi
diff --git a/CHANGELOG-6.0.md b/CHANGELOG-6.0.md
index cc075a6faef9d..fdfff3311a2d5 100644
--- a/CHANGELOG-6.0.md
+++ b/CHANGELOG-6.0.md
@@ -7,6 +7,70 @@ 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.13 (2022-09-30)
+
+ * bug #47637 [FrameworkBundle] Fix passing `serializer.default_context` option to normalizers (wuchen90)
+ * bug #47695 [FrameworkBundle] Filter out trans paths that are covered by a parent folder path (natewiebe13)
+ * bug #45554 [Serializer] Fixed framework.serializer.default_context is not working for JsonEncoder (siganushka)
+ * bug #47547 [Ldap] Do not run ldap_set_option on failed connection (tatankat)
+ * bug #47635 [DependencyInjection] EnvPlaceholderParameterBag::get() can't return UnitEnum (jack.shpartko)
+ * bug #47578 [Security] Fix AbstractFormLoginAuthenticator return types (AndrolGenhald)
+ * bug #47614 [FrameworkBundle] Fix a phpdoc in mailer assertions (HeahDude)
+ * bug #47516 [HttpFoundation] Prevent BinaryFileResponse::prepare from adding content type if no content is sent (naitsirch)
+ * bug #47533 [Messenger] decode URL-encoded characters in DSN's usernames/passwords (xabbuh)
+ * bug #47530 [HttpFoundation] Always return strings from accept headers (ausi)
+ * bug #47523 [Uid] Ensure ULIDs are monotonic even when the time goes backward (nicolas-grekas)
+ * bug #47528 [Form] fix UUID tranformer (nicolas-grekas)
+ * bug #47488 [Security] Fix valid remember-me token exposure to the second consequent request (Ivan Kurnosov)
+ * bug #47518 [Uid] Fix validating UUID variant bits (nicolas-grekas)
+ * bug #47441 [HttpClient] [HttpClientBundle] Bugfix for delayed retryableHttpClient (martkop26)
+ * bug #47499 [Uid][Validator] Stop to first ULID format violation (ogizanagi)
+ * bug #47491 [HttpKernel] Prevent exception in RequestDataCollector if request stack is empty (aschempp)
+ * bug #47497 [Bridge] Fix mkdir() race condition in ProxyCacheWarmer (andrey-tech)
+ * bug #47415 [HttpClient] Psr18Client ignore invalid HTTP headers (nuryagdym)
+ * bug #47394 [Console] [Completion] Make bash completion run in non interactive mode (Seldaek)
+ * bug #47455 [Mime] Fix TextPart broken after being serialized (fabpot)
+ * bug #47423 [String] CamelCase/SnakeCase on uppercase word (mpiot)
+ * bug #47435 [HttpKernel] lock when writting profiles (nicolas-grekas)
+ * bug #47417 [WebProfilerBundle] Fix profile search bar link query params (HeahDude)
+ * bug #47437 [Mime] Fix email rendering when having inlined parts that are not related to the content (fabpot)
+ * bug #47434 [HttpFoundation] move flushing outside of Response::closeOutputBuffers (nicolas-grekas)
+ * bug #47351 [FrameworkBundle] Do not throw when describing a factory definition (MatTheCat)
+ * bug #47403 [Mailer] Fix edge cases in STMP transports (fabpot)
+ * bug #47372 [Console] Fix OutputFormatterStyleStack::getCurrent return type (alamirault)
+ * bug #47391 [LokaliseBridge] Fix push command --delete-missing options when there are no missing messages (rwionczek)
+ * bug #47368 [Security] Count remember me cookie parts before accessing the second (MatTheCat)
+ * bug #47358 Fix broken request stack state if throwable is thrown. (Warxcell)
+ * bug #47304 [Serializer] Fix caching context-aware encoders/decoders in ChainEncoder/ChainDecoder (Guite)
+ * bug #47329 Email image parts: regex for single closing quote (rr-it)
+ * bug #47335 [Security] [AbstractToken] getUserIdentifier() must return a string (mpiot)
+ * bug #47283 [HttpFoundation] Prevent accepted rate limits with no remaining token to be preferred over denied ones (MatTheCat)
+ * bug #47128 [Serializer] Throw InvalidArgumentException if the data needed in the constructor doesn't belong to a backedEnum (allison guilhem)
+ * bug #47273 [HttpFoundation] Do not send Set-Cookie header twice for deleted session cookie (X-Coder264)
+ * bug #47255 [Serializer] Fix get accessor regex in AnnotationLoader (jsor)
+ * bug #47238 [HttpKernel] Fix passing `null` to `\trim()` method in LoggerDataCollector (SVillette)
+ * bug #47216 [Translation] Crowdin provider throw Exception when status is 50x (alamirault)
+ * bug #47209 Always attempt to listen for notifications (goetas)
+ * bug #47211 [Validator] validate nested constraints only if they are in the same group (xabbuh)
+ * bug #47218 [Console] fix dispatch signal event check for compatibility with the contract interface (xabbuh)
+ * bug #47200 [Form] ignore missing keys when mapping DateTime objects to uninitialized arrays (xabbuh)
+ * bug #47189 [Validator] Add additional hint when `egulias/email-validator` needs to be installed (mpdude)
+ * bug #47195 [FrameworkBundle] fix writes to static $kernel property (xabbuh)
+ * bug #47185 [String] Fix snake conversion (simPod)
+ * bug #47175 [DowCrawler] Fix locale-sensitivity of whitespace normalization (nicolas-grekas)
+ * bug #47171 [TwigBridge] suggest to install the Twig bundle when the required component is already installed (xabbuh)
+ * bug #47169 [Serializer] Fix throwing right exception in ArrayDenormalizer with invalid type (norkunas)
+ * bug #47161 [Mailer] Fix logic (fabpot)
+ * bug #47157 [Messenger] Fix Doctrine transport on MySQL (nicolas-grekas)
+ * bug #47155 [Filesystem] Remove needless `mb_*` calls (HellFirePvP)
+ * bug #46190 [Translation] Fix translator overlapse (Xavier RENAUDIN)
+ * bug #47142 [Mailer] Fix error message in case of an STMP error (fabpot)
+ * bug #45333 [Console] Fix ConsoleEvents::SIGNAL subscriber dispatch (GwendolenLynch)
+ * bug #47145 [HttpClient] Fix shared connections not being freed on PHP < 8 (nicolas-grekas)
+ * bug #47143 [HttpClient] Fix memory leak when using StreamWrapper (nicolas-grekas)
+ * bug #47130 [HttpFoundation] Fix invalid ID not regenerated with native PHP file sessions (BrokenSourceCode)
+ * bug #47129 [FrameworkBundle] remove the ChatterInterface alias when the chatter service is removed (xabbuh)
+
* 6.0.12 (2022-08-26)
* bug #47372 [Console] Fix OutputFormatterStyleStack::getCurrent return type (alamirault)
@@ -799,4 +863,3 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
* feature #41298 [Notifier] Remove deprecation in slack-notifier (jschaedl)
* feature #41203 [FrameworkBundle] Add autowiring alias for `HttpCache\StoreInterface` (nicolas-grekas)
* feature #41282 Bump Symfony 6 to PHP 8 (nicolas-grekas)
-
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 99d8c121d9fce..167d559dc9e9f 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -24,8 +24,8 @@ The Symfony Connect username in parenthesis allows to get more information
- Yonel Ceruto (yonelceruto)
- Tobias Nyholm (tobias)
- Oskar Stark (oskarstark)
- - Ryan Weaver (weaverryan)
- Javier Eguiluz (javier.eguiluz)
+ - Ryan Weaver (weaverryan)
- Johannes S (johannes)
- Jakub Zalas (jakubzalas)
- Kris Wallsmith (kriswallsmith)
@@ -43,9 +43,9 @@ The Symfony Connect username in parenthesis allows to get more information
- Martin Hasoň (hason)
- Jérôme Tamarelle (gromnan)
- Jeremy Mikola (jmikola)
+ - Kevin Bond (kbond)
- Jean-François Simon (jfsimon)
- Benjamin Eberlei (beberlei)
- - Kevin Bond (kbond)
- Igor Wiedler
- Valentin Udaltsov (vudaltsov)
- Vasilij Duško (staff)
@@ -84,8 +84,8 @@ The Symfony Connect username in parenthesis allows to get more information
- Sarah Khalil (saro0h)
- Konstantin Kudryashov (everzet)
- Vincent Langlet (deviling)
- - Bilal Amarni (bamarni)
- Tomas Norkūnas (norkunas)
+ - Bilal Amarni (bamarni)
- Eriksen Costa
- Florin Patan (florinpatan)
- Peter Rehm (rpet)
@@ -95,14 +95,14 @@ The Symfony Connect username in parenthesis allows to get more information
- Julien Falque (julienfalque)
- Massimiliano Arione (garak)
- Douglas Greenshields (shieldo)
- - Christian Raue
- David Buchmann (dbu)
+ - Christian Raue
+ - Jáchym Toušek (enumag)
- Graham Campbell (graham)
- Michel Weimerskirch (mweimerskirch)
- Eric Clemmons (ericclemmons)
- Issei Murasawa (issei_m)
- Fran Moreno (franmomu)
- - Jáchym Toušek (enumag)
- Malte Schlüter (maltemaltesich)
- Mathias Arlaud (mtarld)
- Vasilij Dusko
@@ -114,8 +114,8 @@ The Symfony Connect username in parenthesis allows to get more information
- Dariusz Górecki (canni)
- Maxime Helias (maxhelias)
- Ener-Getick
- - Sebastiaan Stok (sstok)
- Ruud Kamphuis (ruudk)
+ - Sebastiaan Stok (sstok)
- Jérôme Vasseur (jvasseur)
- Ion Bazan (ionbazan)
- Lee McDermott
@@ -134,6 +134,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Konstantin.Myakshin
- Rokas Mikalkėnas (rokasm)
- Arman Hosseini (arman)
+ - Antoine Lamirault
- Arnaud Le Blanc (arnaud-lb)
- Maxime STEINHAUSSER
- Peter Kokot (maastermedia)
@@ -146,10 +147,10 @@ The Symfony Connect username in parenthesis allows to get more information
- YaFou
- Gary PEGEOT (gary-p)
- Chris Wilkinson (thewilkybarkid)
+ - Mathieu Lechat (mat_the_cat)
- Brice BERNARD (brikou)
- Roman Martinuk (a2a4)
- Gregor Harlan (gharlan)
- - Antoine Lamirault
- Baptiste Clavié (talus)
- Adrien Brault (adrienbrault)
- Michal Piotrowski
@@ -161,7 +162,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Włodzimierz Gajda (gajdaw)
- Christian Scheb
- Guillaume (guill)
- - Mathieu Lechat (mat_the_cat)
- Tugdual Saunier (tucksaun)
- Jacob Dreesen (jdreesen)
- Joel Wurtz (brouznouf)
@@ -173,6 +173,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Javier Spagnoletti (phansys)
- excelwebzone
- Jérôme Parmentier (lctrs)
+ - Jeroen Spee (jeroens)
- HeahDude
- Richard van Laak (rvanlaak)
- Paráda József (paradajozsef)
@@ -180,7 +181,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Alexander Schwenn (xelaris)
- Fabien Pennequin (fabienpennequin)
- Gordon Franke (gimler)
- - Jeroen Spee (jeroens)
- Christopher Hertel (chertel)
- Gabriel Caruso
- Anthony GRASSIOT (antograssiot)
@@ -207,6 +207,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Jhonny Lidfors (jhonne)
- Martin Hujer (martinhujer)
- Wouter J
+ - Guilliam Xavier
- Timo Bakx (timobakx)
- Juti Noppornpitak (shiroyuki)
- Joe Bennett (kralos)
@@ -215,6 +216,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Colin O'Dell (colinodell)
- Sebastian Hörl (blogsh)
- Ben Davies (bendavies)
+ - Andreas Schempp (aschempp)
- François-Xavier de Guillebon (de-gui_f)
- Daniel Gomes (danielcsgomes)
- Michael Käfer (michael_kaefer)
@@ -223,11 +225,10 @@ The Symfony Connect username in parenthesis allows to get more information
- Arnaud Kleinpeter (nanocom)
- Guilherme Blanco (guilhermeblanco)
- Chi-teck
- - Guilliam Xavier
+ - Antonio Pauletich (x-coder264)
- Nate Wiebe (natewiebe13)
- Michael Voříšek
- SpacePossum
- - Andreas Schempp (aschempp)
- Pablo Godel (pgodel)
- Romaric Drigon (romaricdrigon)
- Andréia Bohner (andreia)
@@ -239,7 +240,6 @@ The Symfony Connect username in parenthesis allows to get more information
- jwdeitch
- Jurica Vlahoviček (vjurica)
- David Prévot
- - Antonio Pauletich (x-coder264)
- Vincent Touzet (vincenttouzet)
- Fabien Bourigault (fbourigault)
- Farhad Safarov (safarov)
@@ -373,9 +373,11 @@ The Symfony Connect username in parenthesis allows to get more information
- Emanuele Panzeri (thepanz)
- Matthew Smeets
- François Zaninotto (fzaninotto)
+ - Alexis Lefebvre
- Dustin Whittle (dustinwhittle)
- jeff
- John Kary (johnkary)
+ - Bob van de Vijver (bobvandevijver)
- smoench
- Michele Orselli (orso)
- Sven Paulus (subsven)
@@ -397,8 +399,10 @@ The Symfony Connect username in parenthesis allows to get more information
- Fabien S (bafs)
- Victor Bocharsky (bocharsky_bw)
- Sébastien Alfaiate (seb33300)
+ - Jan Sorgalla (jsor)
- henrikbjorn
- Alex Bowers
+ - Simon Podlipsky (simpod)
- Marcel Beerta (mazen)
- Phil Taylor (prazgod)
- flack (flack)
@@ -426,7 +430,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Iker Ibarguren (ikerib)
- Manuel Reinhard (sprain)
- Johann Pardanaud
- - Alexis Lefebvre
- Indra Gunawan (indragunawan)
- Tim Goudriaan (codedmonkey)
- Harm van Tilborg (hvt)
@@ -444,7 +447,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Xavier Montaña Carreras (xmontana)
- Tarmo Leppänen (tarlepp)
- AnneKir
- - Bob van de Vijver (bobvandevijver)
- Tobias Weichart
- Miro Michalicka
- M. Vondano
@@ -473,12 +475,10 @@ The Symfony Connect username in parenthesis allows to get more information
- Félix Labrecque (woodspire)
- GordonsLondon
- Roman Anasal
- - Jan Sorgalla (jsor)
- Piotr Kugla (piku235)
- Quynh Xuan Nguyen (seriquynh)
- Ray
- Philipp Cordes (corphi)
- - Simon Podlipsky (simpod)
- Chekote
- bhavin (bhavin4u)
- Pavel Popov (metaer)
@@ -495,12 +495,14 @@ The Symfony Connect username in parenthesis allows to get more information
- Thomas Schulz (king2500)
- Benjamin Morel
- Bernd Stellwag
+ - Romain Monteil (ker0x)
- Frank de Jonge
- Chris Tanaskoski
- julien57
- Loïc Frémont (loic425)
- Ben Ramsey (ramsey)
- Matthieu Auger (matthieuauger)
+ - Kévin THERAGE (kevin_therage)
- Josip Kruslin (jkruslin)
- Giorgio Premi
- renanbr
@@ -526,6 +528,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Michael Holm (hollo)
- Giso Stallenberg (gisostallenberg)
- Blanchon Vincent (blanchonvincent)
+ - William Arslett (warslett)
- Christian Schmidt
- Gonzalo Vilaseca (gonzalovilaseca)
- Vadim Borodavko (javer)
@@ -575,7 +578,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Marko Kaznovac (kaznovac)
- Emanuele Gaspari (inmarelibero)
- Dariusz Rumiński
- - Romain Monteil (ker0x)
- Terje Bråten
- Gennadi Janzen
- James Hemery
@@ -599,7 +601,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Fractal Zombie
- Gunnstein Lye (glye)
- Thomas Talbot (ioni)
- - Kévin THERAGE (kevin_therage)
- Noémi Salaün (noemi-salaun)
- Michel Hunziker
- Krystian Marcisz (simivar)
@@ -623,6 +624,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Thomas Royer (cydonia7)
- Gildas Quéméner (gquemener)
- Nicolas LEFEVRE (nicoweb)
+ - Asmir Mustafic (goetas)
- Martins Sipenko
- Guilherme Augusto Henschel
- Mardari Dorel (dorumd)
@@ -662,7 +664,6 @@ The Symfony Connect username in parenthesis allows to get more information
- “Filip
- Simon Watiau (simonwatiau)
- Ruben Jacobs (rubenj)
- - William Arslett
- Arkadius Stefanski (arkadius)
- Jérémy M (th3mouk)
- Terje Bråten
@@ -700,6 +701,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Philipp Kräutli (pkraeutli)
- Carl Casbolt (carlcasbolt)
- battye
+ - BrokenSourceCode
- Grzegorz (Greg) Zdanowski (kiler129)
- Kirill chEbba Chebunin
- kylekatarnls (kylekatarnls)
@@ -850,7 +852,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Arturs Vonda
- Xavier Briand (xavierbriand)
- Daniel Badura
- - Asmir Mustafic (goetas)
- vagrant
- Asier Illarramendi (doup)
- AKeeman (akeeman)
@@ -861,6 +862,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Chris Sedlmayr (catchamonkey)
- Kamil Kokot (pamil)
- Seb Koelen
+ - FORT Pierre-Louis (plfort)
- Christoph Mewes (xrstf)
- Vitaliy Tverdokhlib (vitaliytv)
- Ariel Ferrandini (aferrandini)
@@ -900,7 +902,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Pablo Díez (pablodip)
- Damien Fa
- Kevin McBride
- - BrokenSourceCode
- Sergio Santoro
- Philipp Rieber (bicpi)
- Dennis Væversted (srnzitcom)
@@ -988,6 +989,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Ziumin
- Matthias Schmidt
- Lenar Lõhmus
+ - Samaël Villette (samadu61)
- Zach Badgett (zachbadgett)
- Loïc Faugeron
- Aurélien Fredouelle
@@ -1049,6 +1051,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Simon DELICATA
- Thibault Buathier (gwemox)
- vitaliytv
+ - Andreas Hennings
- Arnaud Frézet
- Nicolas Martin (cocorambo)
- luffy1727
@@ -1136,6 +1139,7 @@ The Symfony Connect username in parenthesis allows to get more information
- David Fuhr
- Evgeny Anisiforov
- TristanPouliquen
+ - Gwendolen Lynch
- mwos
- Aurimas Niekis (gcds)
- Volker Killesreiter (ol0lll)
@@ -1189,7 +1193,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Chris Heng (gigablah)
- Oleksii Svitiashchuk
- Tristan Bessoussa (sf_tristanb)
- - FORT Pierre-Louis (plfort)
- Richard Bradley
- Nathanaël Martel (nathanaelmartel)
- Nicolas Jourdan (nicolasjc)
@@ -1259,6 +1262,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Aleksandr Dankovtsev
- Maciej Zgadzaj
- David Legatt (dlegatt)
+ - Maarten de Boer (mdeboer)
- Cameron Porter
- Hossein Bukhamsin
- Oliver Hoff
@@ -1463,6 +1467,7 @@ The Symfony Connect username in parenthesis allows to get more information
- bill moll
- PaoRuby
- Bizley
+ - Edvin Hultberg
- Dominik Piekarski (dompie)
- Rares Sebastian Moldovan (raresmldvn)
- Felds Liscia (felds)
@@ -1773,7 +1778,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Pierre-Olivier Vares (povares)
- Ronny López (ronnylt)
- Julius (sakalys)
- - Samaël Villette (samadu61)
- abdul malik ikhsan (samsonasik)
- Dmitry (staratel)
- Tito Miguel Costa (titomiguelcosta)
@@ -1956,6 +1960,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Daniel Alejandro Castro Arellano (lexcast)
- Aleksandar Dimitrov (netbull)
- Gary Houbre (thegarious)
+ - Florent Morselli
- Thomas Jarrand
- Baptiste Leduc (bleduc)
- Antoine Bluchet (soyuka)
@@ -2053,6 +2058,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Pablo Borowicz
- Máximo Cuadros (mcuadros)
- Lukas Mencl
+ - EXT - THERAGE Kevin
- tamirvs
- gauss
- julien.galenski
@@ -2067,6 +2073,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Goran Juric
- Laurent G. (laurentg)
- Nicolas Macherey
+ - Asil Barkin Elik (asilelik)
- Bhujagendra Ishaya
- Guido Donnari
- Mert Simsek (mrtsmsk0)
@@ -2097,6 +2104,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Dan Finnie
- Ken Marfilla (marfillaster)
- Max Grigorian (maxakawizard)
+ - allison guilhem
- benatespina (benatespina)
- Denis Kop
- Jean-Guilhem Rouel (jean-gui)
@@ -2130,6 +2138,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Tadas Gliaubicas (tadcka)
- Thanos Polymeneas (thanos)
- Benoit Garret
+ - HellFirePvP
- Maximilian Ruta (deltachaos)
- Jakub Sacha
- Olaf Klischat
@@ -2194,6 +2203,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Philipp Kretzschmar
- Ilya Vertakov
- Brooks Boyd
+ - Axel Venet
- Roger Webb
- Dmitriy Simushev
- Pawel Smolinski
@@ -2201,7 +2211,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Oxan van Leeuwen
- pkowalczyk
- Soner Sayakci
- - Andreas Hennings
- Max Voloshin (maxvoloshin)
- Nicolas Fabre (nfabre)
- Raul Rodriguez (raul782)
@@ -2238,6 +2247,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Dmitri Petmanson
- heccjj
- Alexandre Melard
+ - AlbinoDrought
- Jay Klehr
- Sergey Yuferev
- Tobias Stöckler
@@ -2247,6 +2257,7 @@ The Symfony Connect username in parenthesis allows to get more information
- cilefen (cilefen)
- Mo Di (modi)
- Pablo Schläpfer
+ - Xavier RENAUDIN
- Christian Wahler (christian)
- Jelte Steijaert (jelte)
- David Négrier (moufmouf)
@@ -2268,6 +2279,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Malaney J. Hill
- Patryk Kozłowski
- Alexandre Pavy
+ - Tim Ward
- Christian Flach (cmfcmf)
- Lars Ambrosius Wallenborn (larsborn)
- Oriol Mangas Abellan (oriolman)
@@ -2282,6 +2294,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Mihai Nica (redecs)
- Andrei Igna
- azine
+ - Wojciech Zimoń
- Pierre Tachoire
- Dawid Sajdak
- Ludek Stepan
@@ -2363,6 +2376,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Daniel Kay (danielkay-cp)
- Matt Daum (daum)
- Alberto Pirovano (geezmo)
+ - Pascal Woerde (pascalwoerde)
- Pete Mitchell (peterjmit)
- Tom Corrigan (tomcorrigan)
- Luis Galeas
@@ -2479,6 +2493,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Keith Maika
- Mephistofeles
- Hoffmann András
+ - Cédric Anne
- LubenZA
- Flavian Sierk
- Michael Bessolov
@@ -2508,7 +2523,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Alex Teterin (errogaht)
- Gunnar Lium (gunnarlium)
- Malte Wunsch (maltewunsch)
- - Maarten de Boer (mdeboer)
- Tiago Garcia (tiagojsag)
- Artiom
- Jakub Simon
@@ -2635,6 +2649,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Andy Stanberry
- Felix Marezki
- Normunds
+ - Walter Doekes
- Thomas Rothe
- Troy Crawford
- nietonfir
@@ -2952,7 +2967,6 @@ The Symfony Connect username in parenthesis allows to get more information
- temperatur
- Paul Andrieux
- Cas
- - Gwendolen Lynch
- ghazy ben ahmed
- Karolis
- Myke79
@@ -3051,6 +3065,7 @@ The Symfony Connect username in parenthesis allows to get more information
- Shude
- Ondřej Führer
- Sema
+ - Ayke Halder
- Thorsten Hallwas
- Brian Freytag
- Alex Nostadt
@@ -3062,7 +3077,6 @@ The Symfony Connect username in parenthesis allows to get more information
- Yuriy Potemkin
- Emilie Lorenzo
- enomotodev
- - Edvin Hultberg
- Vincent
- Benjamin Long
- Ben Miller
diff --git a/composer.json b/composer.json
index 92ac23ee44b05..5bd56865240b1 100644
--- a/composer.json
+++ b/composer.json
@@ -197,6 +197,15 @@
{
"type": "path",
"url": "src/Symfony/Component/Runtime"
+ },
+ {
+ "type": "path",
+ "url": "src/Symfony/Component/Notifier/Bridge/Mercure/Tests/stella-maris-clock",
+ "options": {
+ "versions": {
+ "stella-maris/clock": "0.1.x-dev"
+ }
+ }
}
],
"minimum-stability": "dev"
diff --git a/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php b/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php
index e90c82af15b4a..fd3fc83eef837 100644
--- a/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php
+++ b/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php
@@ -50,7 +50,7 @@ public function warmUp(string $cacheDir): array
foreach ($this->registry->getManagers() as $em) {
// we need the directory no matter the proxy cache generation strategy
if (!is_dir($proxyCacheDir = $em->getConfiguration()->getProxyDir())) {
- if (false === @mkdir($proxyCacheDir, 0777, true)) {
+ if (false === @mkdir($proxyCacheDir, 0777, true) && !is_dir($proxyCacheDir)) {
throw new \RuntimeException(sprintf('Unable to create the Doctrine Proxy directory "%s".', $proxyCacheDir));
}
} elseif (!is_writable($proxyCacheDir)) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
index e3128ef3c5c1c..3bb0e21331278 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
@@ -395,6 +395,7 @@ private function extractMessages(string $locale, array $transPaths, string $pref
{
$extractedCatalogue = new MessageCatalogue($locale);
$this->extractor->setPrefix($prefix);
+ $transPaths = $this->filterDuplicateTransPaths($transPaths);
foreach ($transPaths as $path) {
if (is_dir($path) || is_file($path)) {
$this->extractor->extract($path, $extractedCatalogue);
@@ -404,6 +405,27 @@ private function extractMessages(string $locale, array $transPaths, string $pref
return $extractedCatalogue;
}
+ private function filterDuplicateTransPaths(array $transPaths): array
+ {
+ $transPaths = array_filter(array_map('realpath', $transPaths));
+
+ sort($transPaths);
+
+ $filteredPaths = [];
+
+ foreach ($transPaths as $path) {
+ foreach ($filteredPaths as $filteredPath) {
+ if (str_starts_with($path, $filteredPath.\DIRECTORY_SEPARATOR)) {
+ continue 2;
+ }
+ }
+
+ $filteredPaths[] = $path;
+ }
+
+ return $filteredPaths;
+ }
+
private function loadCurrentMessages(string $locale, array $transPaths): MessageCatalogue
{
$currentCatalogue = new MessageCatalogue($locale);
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
index 13c76e705da3f..01394ff70179d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
@@ -245,7 +245,7 @@ private function getContainerDefinitionData(Definition $definition, bool $omitTa
if ($factory[0] instanceof Reference) {
$data['factory_service'] = (string) $factory[0];
} elseif ($factory[0] instanceof Definition) {
- throw new \InvalidArgumentException('Factory is not describable.');
+ $data['factory_service'] = sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'class not configured');
} else {
$data['factory_class'] = $factory[0];
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
index b70bfce81260e..810104e0e5c9d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
@@ -224,7 +224,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
if ($factory[0] instanceof Reference) {
$output .= "\n".'- Factory Service: `'.$factory[0].'`';
} elseif ($factory[0] instanceof Definition) {
- throw new \InvalidArgumentException('Factory is not describable.');
+ $output .= "\n".sprintf('- Factory Service: inline factory service (%s)', $factory[0]->getClass() ? sprintf('`%s`', $factory[0]->getClass()) : 'not configured');
} else {
$output .= "\n".'- Factory Class: `'.$factory[0].'`';
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
index c31ad7e9e4954..bfb3c63bec611 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
@@ -315,7 +315,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
if ($factory[0] instanceof Reference) {
$tableRows[] = ['Factory Service', $factory[0]];
} elseif ($factory[0] instanceof Definition) {
- throw new \InvalidArgumentException('Factory is not describable.');
+ $tableRows[] = ['Factory Service', sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'class not configured')];
} else {
$tableRows[] = ['Factory Class', $factory[0]];
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
index 6847c3211fedb..d7187614e8d2c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
@@ -324,7 +324,7 @@ private function getContainerDefinitionDocument(Definition $definition, string $
if ($factory[0] instanceof Reference) {
$factoryXML->setAttribute('service', (string) $factory[0]);
} elseif ($factory[0] instanceof Definition) {
- throw new \InvalidArgumentException('Factory is not describable.');
+ $factoryXML->setAttribute('service', sprintf('inline factory service (%s)', $factory[0]->getClass() ?? 'not configured'));
} else {
$factoryXML->setAttribute('class', $factory[0]);
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php
index c960f12d3954a..5ffc869ca7bd9 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php
@@ -76,7 +76,8 @@
// Normalizer
->set('serializer.normalizer.constraint_violation_list', ConstraintViolationListNormalizer::class)
- ->args([[], service('serializer.name_converter.metadata_aware')])
+ ->args([1 => service('serializer.name_converter.metadata_aware')])
+ ->autowire(true)
->tag('serializer.normalizer', ['priority' => -915])
->set('serializer.normalizer.mime_message', MimeMessageNormalizer::class)
@@ -122,7 +123,6 @@
service('property_info')->ignoreOnInvalid(),
service('serializer.mapping.class_discriminator_resolver')->ignoreOnInvalid(),
null,
- [],
])
->tag('serializer.normalizer', ['priority' => -1000])
@@ -135,7 +135,6 @@
service('property_info')->ignoreOnInvalid(),
service('serializer.mapping.class_discriminator_resolver')->ignoreOnInvalid(),
null,
- [],
])
->alias(PropertyNormalizer::class, 'serializer.normalizer.property')
@@ -174,6 +173,7 @@
->tag('serializer.encoder')
->set('serializer.encoder.json', JsonEncoder::class)
+ ->args([null, null])
->tag('serializer.encoder')
->set('serializer.encoder.yaml', YamlEncoder::class)
diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php b/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php
index 875c84d4813da..1a629d6255fbe 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php
@@ -91,7 +91,7 @@ public static function assertEmailAddressContains(RawMessage $email, string $hea
}
/**
- * @return MessageEvents[]
+ * @return MessageEvent[]
*/
public static function getMailerEvents(string $transport = null): array
{
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
index 5c6fa8ec35ea2..f883fac0c57ce 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
@@ -140,6 +140,46 @@ public function testWriteMessagesForSpecificDomain()
$this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
}
+ public function testFilterDuplicateTransPaths()
+ {
+ $transPaths = [
+ $this->translationDir.'/a/test/folder/with/a/subfolder',
+ $this->translationDir.'/a/test/folder/',
+ $this->translationDir.'/a/test/folder/with/a/subfolder/and/a/file.txt',
+ $this->translationDir.'/a/different/test/folder',
+ ];
+
+ foreach ($transPaths as $transPath) {
+ if (realpath($transPath)) {
+ continue;
+ }
+
+ if (preg_match('/\.[a-z]+$/', $transPath)) {
+ if (!realpath(\dirname($transPath))) {
+ mkdir(\dirname($transPath), 0777, true);
+ }
+
+ touch($transPath);
+ } else {
+ mkdir($transPath, 0777, true);
+ }
+ }
+
+ $command = $this->createMock(TranslationUpdateCommand::class);
+
+ $method = new \ReflectionMethod(TranslationUpdateCommand::class, 'filterDuplicateTransPaths');
+ $method->setAccessible(true);
+
+ $filteredTransPaths = $method->invoke($command, $transPaths);
+
+ $expectedPaths = [
+ realpath($this->translationDir.'/a/different/test/folder'),
+ realpath($this->translationDir.'/a/test/folder'),
+ ];
+
+ $this->assertEquals($expectedPaths, $filteredTransPaths);
+ }
+
protected function setUp(): void
{
$this->fs = new Filesystem();
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
index 02c27c1679fdf..d73ed66d761c3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
@@ -142,6 +142,7 @@ public static function getContainerDefinitions()
{
$definition1 = new Definition('Full\\Qualified\\Class1');
$definition2 = new Definition('Full\\Qualified\\Class2');
+ $definition3 = new Definition('Full\\Qualified\\Class3');
return [
'definition_1' => $definition1
@@ -174,6 +175,9 @@ public static function getContainerDefinitions()
->addTag('tag2')
->addMethodCall('setMailer', [new Reference('mailer')])
->setFactory([new Reference('factory.service'), 'get']),
+ '.definition_3' => $definition3
+ ->setFile('/path/to/file')
+ ->setFactory([new Definition('Full\\Qualified\\FactoryClass'), 'get']),
'definition_without_class' => new Definition(),
];
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
index 0eda1932f7a15..401c588c03d42 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
@@ -34,6 +34,20 @@
"parameters": []
}
]
+ },
+ ".definition_3": {
+ "class": "Full\\Qualified\\Class3",
+ "public": false,
+ "synthetic": false,
+ "lazy": false,
+ "shared": true,
+ "abstract": false,
+ "autowire": false,
+ "autoconfigure": false,
+ "file": "\/path\/to\/file",
+ "factory_service": "inline factory service (Full\\Qualified\\FactoryClass)",
+ "factory_method": "get",
+ "tags": []
}
},
"aliases": {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
index d793c5900a65a..d6daca9971dc7 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
@@ -25,6 +25,20 @@ Definitions
- Attr3: val3
- Tag: `tag2`
+### .definition_3
+
+- Class: `Full\Qualified\Class3`
+- Public: no
+- Synthetic: no
+- Lazy: no
+- Shared: yes
+- Abstract: no
+- Autowired: no
+- Autoconfigured: no
+- File: `/path/to/file`
+- Factory Service: inline factory service (`Full\Qualified\FactoryClass`)
+- Factory Method: `get`
+
Aliases
-------
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt
index cdefb65d208dd..daf47ddc39187 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt
@@ -7,5 +7,6 @@
--------------- ------------------------
.alias_2 alias for ".service_2"
.definition_2 Full\Qualified\Class2
- --------------- ------------------------
+ .definition_3 Full\Qualified\Class3
+ --------------- ------------------------
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
index a311a2e2bb991..b9416fd069d05 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
@@ -17,4 +17,7 @@
*/
diff --git a/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php b/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php
index 0b6f082aaeb94..7466506d5ea65 100644
--- a/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php
+++ b/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php
@@ -29,7 +29,7 @@ class EnvPlaceholderParameterBag extends ParameterBag
/**
* {@inheritdoc}
*/
- public function get(string $name): array|bool|string|int|float|null
+ public function get(string $name): array|bool|string|int|float|\UnitEnum|null
{
if (str_starts_with($name, 'env(') && str_ends_with($name, ')') && 'env()' !== $name) {
$env = substr($name, 4, -1);
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php
index 984abfe7ace55..9495b8c161170 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php
@@ -131,9 +131,6 @@ public function testWithAttributes()
$this->assertEquals($expected, $container->getDefinition((string) $locator->getFactory()[0])->getArgument(0));
}
- /**
- * @requires PHP 8
- */
public function testUnionServices()
{
$container = new ContainerBuilder();
@@ -310,9 +307,6 @@ public function method()
$subscriber::getSubscribedServices();
}
- /**
- * @requires PHP 8
- */
public function testServiceSubscriberTraitWithUnionReturnType()
{
if (!class_exists(SubscribedService::class)) {
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/StringBackedEnum.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/StringBackedEnum.php
new file mode 100644
index 0000000000000..b118cc7550eb8
--- /dev/null
+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/StringBackedEnum.php
@@ -0,0 +1,17 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\DependencyInjection\Tests\Fixtures;
+
+enum StringBackedEnum: string
+{
+ case Bar = 'bar';
+}
diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php
index 9134f1f6c0186..45cf369e75c6a 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php
@@ -15,6 +15,7 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
+use Symfony\Component\DependencyInjection\Tests\Fixtures\StringBackedEnum;
class EnvPlaceholderParameterBagTest extends TestCase
{
@@ -196,4 +197,15 @@ public function testExtraCharsInProcessor()
$bag->resolve();
$this->assertStringMatchesFormat('env_%s_key_a_b_c_FOO_%s', $bag->get('env(key:a.b-c:FOO)'));
}
+
+ /**
+ * @requires PHP 8.1
+ */
+ public function testGetEnum()
+ {
+ $bag = new EnvPlaceholderParameterBag();
+ $bag->set('ENUM_VAR', StringBackedEnum::Bar);
+ $this->assertInstanceOf(StringBackedEnum::class, $bag->get('ENUM_VAR'));
+ $this->assertEquals(StringBackedEnum::Bar, $bag->get('ENUM_VAR'));
+ }
}
diff --git a/src/Symfony/Component/Filesystem/Path.php b/src/Symfony/Component/Filesystem/Path.php
index 6d3755e0a6ac3..9aa37355a8555 100644
--- a/src/Symfony/Component/Filesystem/Path.php
+++ b/src/Symfony/Component/Filesystem/Path.php
@@ -721,7 +721,7 @@ public static function isBasePath(string $basePath, string $ofPath): bool
}
/**
- * @return non-empty-string[]
+ * @return string[]
*/
private static function findCanonicalParts(string $root, string $pathWithoutRoot): array
{
diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php
index 6e68b5ebe15ea..5320dbf1e2609 100644
--- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php
+++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php
@@ -113,7 +113,7 @@ public function reverseTransform(mixed $value): ?\DateTime
$outputTz = new \DateTimeZone($this->outputTimezone);
$dateTime = \DateTime::createFromFormat($this->parseFormat, $value, $outputTz);
- $lastErrors = \DateTime::getLastErrors();
+ $lastErrors = \DateTime::getLastErrors() ?: ['error_count' => 0, 'warning_count' => 0];
if (0 < $lastErrors['warning_count'] || 0 < $lastErrors['error_count']) {
throw new TransformationFailedException(implode(', ', array_merge(array_values($lastErrors['warnings']), array_values($lastErrors['errors']))));
diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/UuidToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/UuidToStringTransformer.php
index 392ee0b5dd4e6..34ad1cf7678bc 100644
--- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/UuidToStringTransformer.php
+++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/UuidToStringTransformer.php
@@ -60,12 +60,14 @@ public function reverseTransform(mixed $value): ?Uuid
throw new TransformationFailedException('Expected a string.');
}
+ if (!Uuid::isValid($value)) {
+ throw new TransformationFailedException(sprintf('The value "%s" is not a valid UUID.', $value));
+ }
+
try {
- $uuid = new Uuid($value);
+ return Uuid::fromString($value);
} catch (\InvalidArgumentException $e) {
throw new TransformationFailedException(sprintf('The value "%s" is not a valid UUID.', $value), $e->getCode(), $e);
}
-
- return $uuid;
}
}
diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/UuidToStringTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/UuidToStringTransformerTest.php
index f7a93beca8fb9..cb4374535ed70 100644
--- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/UuidToStringTransformerTest.php
+++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/UuidToStringTransformerTest.php
@@ -15,26 +15,15 @@
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Extension\Core\DataTransformer\UuidToStringTransformer;
use Symfony\Component\Uid\Uuid;
+use Symfony\Component\Uid\UuidV1;
class UuidToStringTransformerTest extends TestCase
{
- public function provideValidUuid()
- {
- return [
- ['123e4567-e89b-12d3-a456-426655440000', new Uuid('123e4567-e89b-12d3-a456-426655440000')],
- ];
- }
-
- /**
- * @dataProvider provideValidUuid
- */
- public function testTransform($output, $input)
+ public function testTransform()
{
$transformer = new UuidToStringTransformer();
- $input = new Uuid($input);
-
- $this->assertEquals($output, $transformer->transform($input));
+ $this->assertEquals('123e4567-e89b-12d3-a456-426655440000', $transformer->transform(new UuidV1('123e4567-e89b-12d3-a456-426655440000')));
}
public function testTransformEmpty()
@@ -53,16 +42,11 @@ public function testTransformExpectsUuid()
$transformer->transform('1234');
}
- /**
- * @dataProvider provideValidUuid
- */
- public function testReverseTransform($input, $output)
+ public function testReverseTransform()
{
- $reverseTransformer = new UuidToStringTransformer();
-
- $output = new Uuid($output);
+ $transformer = new UuidToStringTransformer();
- $this->assertEquals($output, $reverseTransformer->reverseTransform($input));
+ $this->assertEquals(new UuidV1('123e4567-e89b-12d3-a456-426655440000'), $transformer->reverseTransform('123e4567-e89b-12d3-a456-426655440000'));
}
public function testReverseTransformEmpty()
@@ -78,7 +62,7 @@ public function testReverseTransformExpectsString()
$this->expectException(TransformationFailedException::class);
- $reverseTransformer->reverseTransform(1234);
+ $reverseTransformer->reverseTransform(Uuid::fromString('123e4567-e89b-12d3-a456-426655440000')->toBase32());
}
public function testReverseTransformExpectsValidUuidString()
diff --git a/src/Symfony/Component/HttpClient/Psr18Client.php b/src/Symfony/Component/HttpClient/Psr18Client.php
index 64898edfa2bcb..b75b1a068efec 100644
--- a/src/Symfony/Component/HttpClient/Psr18Client.php
+++ b/src/Symfony/Component/HttpClient/Psr18Client.php
@@ -101,7 +101,11 @@ public function sendRequest(RequestInterface $request): ResponseInterface
foreach ($response->getHeaders(false) as $name => $values) {
foreach ($values as $value) {
- $psrResponse = $psrResponse->withAddedHeader($name, $value);
+ try {
+ $psrResponse = $psrResponse->withAddedHeader($name, $value);
+ } catch (\InvalidArgumentException $e) {
+ // ignore invalid header
+ }
}
}
diff --git a/src/Symfony/Component/HttpClient/RetryableHttpClient.php b/src/Symfony/Component/HttpClient/RetryableHttpClient.php
index 3c7c7aae0e93a..6b9f571651fa0 100644
--- a/src/Symfony/Component/HttpClient/RetryableHttpClient.php
+++ b/src/Symfony/Component/HttpClient/RetryableHttpClient.php
@@ -138,7 +138,7 @@ private function getDelayFromHeader(array $headers): ?int
{
if (null !== $after = $headers['retry-after'][0] ?? null) {
if (is_numeric($after)) {
- return (int) $after * 1000;
+ return (int) ($after * 1000);
}
if (false !== $time = strtotime($after)) {
diff --git a/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php b/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php
index 1ef36fc5bd09e..366d555ae03f9 100644
--- a/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php
+++ b/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php
@@ -13,10 +13,12 @@
use Nyholm\Psr7\Factory\Psr17Factory;
use PHPUnit\Framework\TestCase;
+use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\NativeHttpClient;
use Symfony\Component\HttpClient\Psr18Client;
use Symfony\Component\HttpClient\Psr18NetworkException;
use Symfony\Component\HttpClient\Psr18RequestException;
+use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Contracts\HttpClient\Test\TestHttpServer;
class Psr18ClientTest extends TestCase
@@ -81,4 +83,22 @@ public function test404()
$response = $client->sendRequest($factory->createRequest('GET', 'http://localhost:8057/404'));
$this->assertSame(404, $response->getStatusCode());
}
+
+ public function testInvalidHeaderResponse()
+ {
+ $responseHeaders = [
+ // space in header name not allowed in RFC 7230
+ ' X-XSS-Protection' => '0',
+ 'Cache-Control' => 'no-cache',
+ ];
+ $response = new MockResponse('body', ['response_headers' => $responseHeaders]);
+ $this->assertArrayHasKey(' x-xss-protection', $response->getHeaders());
+
+ $client = new Psr18Client(new MockHttpClient($response));
+ $request = $client->createRequest('POST', 'http://localhost:8057/post')
+ ->withBody($client->createStream('foo=0123456789'));
+
+ $resultResponse = $client->sendRequest($request);
+ $this->assertCount(1, $resultResponse->getHeaders());
+ }
}
diff --git a/src/Symfony/Component/HttpClient/Tests/RetryableHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/RetryableHttpClientTest.php
index 6bd9a1f15e788..85a03fd225183 100644
--- a/src/Symfony/Component/HttpClient/Tests/RetryableHttpClientTest.php
+++ b/src/Symfony/Component/HttpClient/Tests/RetryableHttpClientTest.php
@@ -187,4 +187,42 @@ public function testCancelOnTimeout()
$response->cancel();
}
}
+
+ public function testRetryWithDelay()
+ {
+ $retryAfter = '0.46';
+
+ $client = new RetryableHttpClient(
+ new MockHttpClient([
+ new MockResponse('', [
+ 'http_code' => 503,
+ 'response_headers' => [
+ 'retry-after' => $retryAfter,
+ ],
+ ]),
+ new MockResponse('', [
+ 'http_code' => 200,
+ ]),
+ ]),
+ new GenericRetryStrategy(),
+ 1,
+ $logger = new class() extends TestLogger {
+ public $context = [];
+
+ public function log($level, $message, array $context = []): void
+ {
+ $this->context = $context;
+ parent::log($level, $message, $context);
+ }
+ }
+ );
+
+ $client->request('GET', 'http://example.com/foo-bar')->getContent();
+
+ $delay = $logger->context['delay'] ?? null;
+
+ $this->assertArrayHasKey('delay', $logger->context);
+ $this->assertNotNull($delay);
+ $this->assertSame((int) ($retryAfter * 1000), $delay);
+ }
}
diff --git a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
index 182898ffb160c..50ad335836377 100644
--- a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
+++ b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
@@ -182,15 +182,17 @@ public function setContentDisposition(string $disposition, string $filename = ''
*/
public function prepare(Request $request): static
{
- if (!$this->headers->has('Content-Type')) {
- $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream');
- }
+ parent::prepare($request);
- if ('HTTP/1.0' !== $request->server->get('SERVER_PROTOCOL')) {
- $this->setProtocolVersion('1.1');
+ if ($this->isInformational() || $this->isEmpty()) {
+ $this->maxlen = 0;
+
+ return $this;
}
- $this->ensureIEOverSSLCompatibility($request);
+ if (!$this->headers->has('Content-Type')) {
+ $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream');
+ }
$this->offset = 0;
$this->maxlen = -1;
@@ -198,6 +200,7 @@ public function prepare(Request $request): static
if (false === $fileSize = $this->file->getSize()) {
return $this;
}
+ $this->headers->remove('Transfer-Encoding');
$this->headers->set('Content-Length', $fileSize);
if (!$this->headers->has('Accept-Ranges')) {
@@ -267,6 +270,10 @@ public function prepare(Request $request): static
}
}
+ if ($request->isMethod('HEAD')) {
+ $this->maxlen = 0;
+ }
+
return $this;
}
@@ -288,40 +295,42 @@ private function hasValidIfRangeHeader(?string $header): bool
*/
public function sendContent(): static
{
- if (!$this->isSuccessful()) {
- return parent::sendContent();
- }
+ try {
+ if (!$this->isSuccessful()) {
+ return parent::sendContent();
+ }
- if (0 === $this->maxlen) {
- return $this;
- }
+ if (0 === $this->maxlen) {
+ return $this;
+ }
- $out = fopen('php://output', 'w');
- $file = fopen($this->file->getPathname(), 'r');
+ $out = fopen('php://output', 'w');
+ $file = fopen($this->file->getPathname(), 'r');
- ignore_user_abort(true);
+ ignore_user_abort(true);
- if (0 !== $this->offset) {
- fseek($file, $this->offset);
- }
+ if (0 !== $this->offset) {
+ fseek($file, $this->offset);
+ }
- $length = $this->maxlen;
- while ($length && !feof($file)) {
- $read = ($length > $this->chunkSize) ? $this->chunkSize : $length;
- $length -= $read;
+ $length = $this->maxlen;
+ while ($length && !feof($file)) {
+ $read = ($length > $this->chunkSize) ? $this->chunkSize : $length;
+ $length -= $read;
- stream_copy_to_stream($file, $out, $read);
+ stream_copy_to_stream($file, $out, $read);
- if (connection_aborted()) {
- break;
+ if (connection_aborted()) {
+ break;
+ }
}
- }
- fclose($out);
- fclose($file);
-
- if ($this->deleteFileAfterSend && is_file($this->file->getPathname())) {
- unlink($this->file->getPathname());
+ fclose($out);
+ fclose($file);
+ } finally {
+ if ($this->deleteFileAfterSend && is_file($this->file->getPathname())) {
+ unlink($this->file->getPathname());
+ }
}
return $this;
diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php
index 101e6921a015b..a2b02c4f821d3 100644
--- a/src/Symfony/Component/HttpFoundation/Request.php
+++ b/src/Symfony/Component/HttpFoundation/Request.php
@@ -1575,7 +1575,8 @@ public function getLanguages(): array
$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all();
$this->languages = [];
- foreach ($languages as $lang => $acceptHeaderItem) {
+ foreach ($languages as $acceptHeaderItem) {
+ $lang = $acceptHeaderItem->getValue();
if (str_contains($lang, '-')) {
$codes = explode('-', $lang);
if ('i' === $codes[0]) {
@@ -1611,7 +1612,7 @@ public function getCharsets(): array
return $this->charsets;
}
- return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all());
+ return $this->charsets = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()));
}
/**
@@ -1623,7 +1624,7 @@ public function getEncodings(): array
return $this->encodings;
}
- return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
+ return $this->encodings = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all()));
}
/**
@@ -1635,7 +1636,7 @@ public function getAcceptableContentTypes(): array
return $this->acceptableContentTypes;
}
- return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all());
+ return $this->acceptableContentTypes = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()));
}
/**
diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php
index 45e243a21a12e..c48efdfb74fb7 100644
--- a/src/Symfony/Component/HttpFoundation/Response.php
+++ b/src/Symfony/Component/HttpFoundation/Response.php
@@ -378,6 +378,7 @@ public function send(): static
litespeed_finish_request();
} elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
static::closeOutputBuffers(0, true);
+ flush();
}
return $this;
@@ -1221,7 +1222,6 @@ public static function closeOutputBuffers(int $targetLevel, bool $flush): void
while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || ($s['flags'] & $flags) === $flags : $s['del'])) {
if ($flush) {
ob_end_flush();
- flush();
} else {
ob_end_clean();
}
diff --git a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
index 5be4feab8309b..b70d331ffd11b 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
@@ -373,6 +373,21 @@ public function testStream()
$this->assertNull($response->headers->get('Content-Length'));
}
+ public function testPrepareNotAddingContentTypeHeaderIfNoContentResponse()
+ {
+ $request = Request::create('/');
+ $request->headers->set('If-Modified-Since', date('D, d M Y H:i:s').' GMT');
+
+ $response = new BinaryFileResponse(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream']);
+ $response->setLastModified(new \DateTimeImmutable('-1 day'));
+ $response->isNotModified($request);
+
+ $response->prepare($request);
+
+ $this->assertSame(BinaryFileResponse::HTTP_NOT_MODIFIED, $response->getStatusCode());
+ $this->assertFalse($response->headers->has('Content-Type'));
+ }
+
protected function provideResponse()
{
return new BinaryFileResponse(__DIR__.'/../README.md', 200, ['Content-Type' => 'application/octet-stream']);
diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
index b9f36d75a5235..3e00ec1775980 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
@@ -1607,6 +1607,20 @@ public function testGetLanguages()
$this->assertEquals(['zh', 'cherokee'], $request->getLanguages());
}
+ public function testGetAcceptHeadersReturnString()
+ {
+ $request = new Request();
+ $request->headers->set('Accept', '123');
+ $request->headers->set('Accept-Charset', '123');
+ $request->headers->set('Accept-Encoding', '123');
+ $request->headers->set('Accept-Language', '123');
+
+ $this->assertSame(['123'], $request->getAcceptableContentTypes());
+ $this->assertSame(['123'], $request->getCharsets());
+ $this->assertSame(['123'], $request->getEncodings());
+ $this->assertSame(['123'], $request->getLanguages());
+ }
+
public function testGetRequestFormat()
{
$request = new Request();
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
index 00647dd1394d4..5da47057ae5b1 100644
--- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
+++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
@@ -110,7 +110,7 @@ public function collect(Request $request, Response $response, \Throwable $except
'session_metadata' => $sessionMetadata,
'session_attributes' => $sessionAttributes,
'session_usages' => array_values($this->sessionUsages),
- 'stateless_check' => $this->requestStack && $this->requestStack->getMainRequest()->attributes->get('_stateless', false),
+ 'stateless_check' => $this->requestStack?->getMainRequest()?->attributes->get('_stateless') ?? false,
'flashes' => $flashes,
'path_info' => $request->getPathInfo(),
'controller' => 'n/a',
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index 697a69b4bce12..9bddd8202f8f6 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -78,11 +78,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
private static array $freshCache = [];
- public const VERSION = '6.0.12';
- public const VERSION_ID = 60012;
+ public const VERSION = '6.0.13';
+ public const VERSION_ID = 60013;
public const MAJOR_VERSION = 6;
public const MINOR_VERSION = 0;
- public const RELEASE_VERSION = 12;
+ public const RELEASE_VERSION = 13;
public const EXTRA_VERSION = '';
public const END_OF_MAINTENANCE = '01/2023';
diff --git a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
index 6e71d0b5103f4..efc786b5aa6f4 100644
--- a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
+++ b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
@@ -113,19 +113,7 @@ public function purge()
*/
public function read(string $token): ?Profile
{
- if (!$token || !file_exists($file = $this->getFilename($token))) {
- return null;
- }
-
- if (\function_exists('gzcompress')) {
- $file = 'compress.zlib://'.$file;
- }
-
- if (!$data = unserialize(file_get_contents($file))) {
- return null;
- }
-
- return $this->createProfileFromData($token, $data);
+ return $this->doRead($token);
}
/**
@@ -167,14 +155,13 @@ public function write(Profile $profile): bool
'status_code' => $profile->getStatusCode(),
];
- $context = stream_context_create();
+ $data = serialize($data);
- if (\function_exists('gzcompress')) {
- $file = 'compress.zlib://'.$file;
- stream_context_set_option($context, 'zlib', 'level', 3);
+ if (\function_exists('gzencode')) {
+ $data = gzencode($data, 3);
}
- if (false === file_put_contents($file, serialize($data), 0, $context)) {
+ if (false === file_put_contents($file, $data, \LOCK_EX)) {
return false;
}
@@ -283,21 +270,34 @@ protected function createProfileFromData(string $token, array $data, Profile $pa
}
foreach ($data['children'] as $token) {
- if (!$token || !file_exists($file = $this->getFilename($token))) {
- continue;
+ if (null !== $childProfile = $this->doRead($token, $profile)) {
+ $profile->addChild($childProfile);
}
+ }
- if (\function_exists('gzcompress')) {
- $file = 'compress.zlib://'.$file;
- }
+ return $profile;
+ }
- if (!$childData = unserialize(file_get_contents($file))) {
- continue;
- }
+ private function doRead($token, Profile $profile = null): ?Profile
+ {
+ if (!$token || !file_exists($file = $this->getFilename($token))) {
+ return null;
+ }
+
+ $h = fopen($file, 'r');
+ flock($h, \LOCK_SH);
+ $data = stream_get_contents($h);
+ flock($h, \LOCK_UN);
+ fclose($h);
- $profile->addChild($this->createProfileFromData($token, $childData, $profile));
+ if (\function_exists('gzdecode')) {
+ $data = @gzdecode($data) ?: $data;
}
- return $profile;
+ if (!$data = unserialize($data)) {
+ return null;
+ }
+
+ return $this->createProfileFromData($token, $data, $profile);
}
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
index 0c576e00ed4dd..d7c8b302b628a 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
@@ -312,6 +312,15 @@ public function testStatelessCheck()
$collector->lateCollect();
$this->assertTrue($collector->getStatelessCheck());
+
+ $requestStack = new RequestStack();
+ $request = $this->createRequest();
+
+ $collector = new RequestDataCollector($requestStack);
+ $collector->collect($request, $response = $this->createResponse());
+ $collector->lateCollect();
+
+ $this->assertFalse($collector->getStatelessCheck());
}
public function testItHidesPassword()
diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
index 4c1c624de2524..824d906340460 100644
--- a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
@@ -120,7 +120,7 @@ public function testRequestLocaleIsNotOverridden()
public function testRequestPreferredLocaleFromAcceptLanguageHeader()
{
$request = Request::create('/');
- $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']);
+ $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5');
$listener = new LocaleListener($this->requestStack, 'de', null, true, ['de', 'fr']);
$event = $this->getEvent($request);
@@ -133,7 +133,7 @@ public function testRequestPreferredLocaleFromAcceptLanguageHeader()
public function testRequestSecondPreferredLocaleFromAcceptLanguageHeader()
{
$request = Request::create('/');
- $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']);
+ $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5');
$listener = new LocaleListener($this->requestStack, 'de', null, true, ['de', 'en']);
$event = $this->getEvent($request);
@@ -146,7 +146,7 @@ public function testRequestSecondPreferredLocaleFromAcceptLanguageHeader()
public function testDontUseAcceptLanguageHeaderIfNotEnabled()
{
$request = Request::create('/');
- $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']);
+ $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5');
$listener = new LocaleListener($this->requestStack, 'de', null, false, ['de', 'en']);
$event = $this->getEvent($request);
@@ -159,7 +159,7 @@ public function testDontUseAcceptLanguageHeaderIfNotEnabled()
public function testRequestUnavailablePreferredLocaleFromAcceptLanguageHeader()
{
$request = Request::create('/');
- $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']);
+ $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5');
$listener = new LocaleListener($this->requestStack, 'de', null, true, ['de', 'it']);
$event = $this->getEvent($request);
@@ -172,7 +172,7 @@ public function testRequestUnavailablePreferredLocaleFromAcceptLanguageHeader()
public function testRequestNoLocaleFromAcceptLanguageHeader()
{
$request = Request::create('/');
- $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']);
+ $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5');
$listener = new LocaleListener($this->requestStack, 'de', null, true);
$event = $this->getEvent($request);
@@ -186,7 +186,7 @@ public function testRequestAttributeLocaleNotOverridenFromAcceptLanguageHeader()
{
$request = Request::create('/');
$request->attributes->set('_locale', 'it');
- $request->headers->set('Accept-Language', ['Accept-Language: fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5']);
+ $request->headers->set('Accept-Language', 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6,es;q=0.5');
$listener = new LocaleListener($this->requestStack, 'de', null, true, ['fr', 'en']);
$event = $this->getEvent($request);
diff --git a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php
index 018bcb8df678e..39a2187e070c8 100644
--- a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php
+++ b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php
@@ -155,7 +155,11 @@ private function connect()
}
}
- $this->connection = ldap_connect($this->config['connection_string']);
+ if (false === $connection = ldap_connect($this->config['connection_string'])) {
+ throw new LdapException('Invalid connection string: '.$this->config['connection_string']);
+ } else {
+ $this->connection = $connection;
+ }
foreach ($this->config['options'] as $name => $value) {
if (!\in_array(ConnectionOptions::getOption($name), self::PRECONNECT_OPTIONS, true)) {
@@ -163,10 +167,6 @@ private function connect()
}
}
- if (false === $this->connection) {
- throw new LdapException('Could not connect to Ldap server: '.ldap_error($this->connection));
- }
-
if ('tls' === $this->config['encryption'] && false === @ldap_start_tls($this->connection)) {
throw new LdapException('Could not initiate TLS connection: '.ldap_error($this->connection));
}
diff --git a/src/Symfony/Component/Mailer/Tests/Transport/Smtp/SmtpTransportTest.php b/src/Symfony/Component/Mailer/Tests/Transport/Smtp/SmtpTransportTest.php
index 5f8d3ba0d8180..c54b050b92963 100644
--- a/src/Symfony/Component/Mailer/Tests/Transport/Smtp/SmtpTransportTest.php
+++ b/src/Symfony/Component/Mailer/Tests/Transport/Smtp/SmtpTransportTest.php
@@ -13,6 +13,7 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Envelope;
+use Symfony\Component\Mailer\Exception\LogicException;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Transport\Smtp\SmtpTransport;
use Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream;
@@ -133,6 +134,35 @@ public function testWriteEncodedRecipientAndSenderAddresses()
$this->assertContains("RCPT TO: