diff --git a/.travis.yml b/.travis.yml index 54171b24066de..f11da4341254e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -171,15 +171,15 @@ before_install: fi tfold ext.apcu tpecl apcu-5.1.17 apcu.so $INI - tfold ext.mongodb tpecl mongodb-1.6.0alpha1 mongodb.so $INI - tfold ext.igbinary tpecl igbinary-2.0.8 igbinary.so $INI + tfold ext.mongodb tpecl mongodb-1.6.0 mongodb.so $INI + tfold ext.igbinary tpecl igbinary-3.1.2 igbinary.so $INI tfold ext.zookeeper tpecl zookeeper-0.7.1 zookeeper.so $INI tfold ext.amqp tpecl amqp-1.9.4 amqp.so $INI tfold ext.redis tpecl redis-4.3.0 redis.so $INI "no" done - | # List all php extensions with versions - - php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;' + php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;' - | # Load fixtures @@ -276,7 +276,7 @@ install: return fi phpenv global $PHP - ([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb) + ([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb ~1.5.0) tfold 'composer update' $COMPOSER_UP tfold 'phpunit install' ./phpunit install if [[ $deps = high ]]; then diff --git a/CHANGELOG-4.3.md b/CHANGELOG-4.3.md index 9c95e7e327a31..7edf539251007 100644 --- a/CHANGELOG-4.3.md +++ b/CHANGELOG-4.3.md @@ -7,6 +7,15 @@ in 4.3 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/v4.3.0...v4.3.1 +* 4.3.11 (2020-01-31) + + * bug #35530 [HttpClient] Fix regex bearer (noniagriconomie) + * bug #35532 [Validator] fix access to uninitialized property when getting value (greedyivan) + * bug #35305 [HttpKernel] Fix stale-if-error behavior, add tests (mpdude) + * bug #34808 [PhpUnitBridge] Properly handle phpunit arguments for configuration file (biozshock) + * bug #35480 [Messenger] Check for all serialization exceptions during message dec… (Patrick Berenschot) + * bug #35428 [Cache] fix checking for igbinary availability (nicolas-grekas) + * 4.3.10 (2020-01-21) * bug #35364 [Yaml] Throw on unquoted exclamation mark (fancyweb) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9a6707977b3ec..aea14fb7e6c5d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,8 +16,8 @@ Symfony is the result of the work of many people who made the code better - Victor Berchet (victor) - Maxime Steinhausser (ogizanagi) - Ryan Weaver (weaverryan) - - Jakub Zalas (jakubzalas) - Javier Eguiluz (javier.eguiluz) + - Jakub Zalas (jakubzalas) - Roland Franssen (ro0) - Grégoire Pineau (lyrixx) - Johannes S (johannes) @@ -32,16 +32,16 @@ Symfony is the result of the work of many people who made the code better - Joseph Bielawski (stloyd) - Alexander M. Turek (derrabus) - Karma Dordrak (drak) + - Thomas Calvet (fancyweb) - Lukas Kahwe Smith (lsmith) - Martin Hasoň (hason) - Hamza Amrouche (simperfit) - Jeremy Mikola (jmikola) - Jules Pietri (heah) - Jean-François Simon (jfsimon) + - Jérémy DERUSSÉ (jderusse) - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - - Jérémy DERUSSÉ (jderusse) - - Thomas Calvet (fancyweb) - Eriksen Costa (eriksencosta) - Guilhem Niot (energetick) - Sarah Khalil (saro0h) @@ -51,13 +51,13 @@ Symfony is the result of the work of many people who made the code better - Diego Saint Esteben (dosten) - Alexandre Salomé (alexandresalome) - William Durand (couac) - - ornicar + - Matthias Pigulla (mpdude) - Pierre du Plessis (pierredup) + - ornicar - Dany Maillard (maidmaid) - Francis Besset (francisbesset) - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - - Matthias Pigulla (mpdude) - Konstantin Myakshin (koc) - Bulat Shakirzyanov (avalanche123) - Valentin Udaltsov (vudaltsov) @@ -81,12 +81,12 @@ Symfony is the result of the work of many people who made the code better - Andrej Hudec (pulzarraider) - Michel Weimerskirch (mweimerskirch) - Issei Murasawa (issei_m) + - Jan Schädlich (jschaedl) - Eric Clemmons (ericclemmons) - Charles Sarrazin (csarrazi) - - Jan Schädlich (jschaedl) - Christian Raue - - Arnout Boks (aboks) - Douglas Greenshields (shieldo) + - Arnout Boks (aboks) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) @@ -130,9 +130,9 @@ Symfony is the result of the work of many people who made the code better - Joshua Thijssen - Alex Pott - Daniel Wehner (dawehner) + - Tugdual Saunier (tucksaun) - excelwebzone - Gordon Franke (gimler) - - Tugdual Saunier (tucksaun) - Fabien Pennequin (fabienpennequin) - Théo FIDRY (theofidry) - Eric GELOEN (gelo) @@ -154,6 +154,7 @@ Symfony is the result of the work of many people who made the code better - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) - Andréia Bohner (andreia) + - Yanick Witschi (toflar) - Julien Falque (julienfalque) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) @@ -168,7 +169,6 @@ Symfony is the result of the work of many people who made the code better - jwdeitch - Mikael Pajunen - Alessandro Chitolina (alekitto) - - Yanick Witschi (toflar) - Niels Keurentjes (curry684) - Vyacheslav Pavlov - Richard van Laak (rvanlaak) @@ -177,8 +177,10 @@ Symfony is the result of the work of many people who made the code better - Vincent Touzet (vincenttouzet) - jeremyFreeAgent (jeremyfreeagent) - Rouven Weßling (realityking) + - Jérôme Parmentier (lctrs) - Clemens Tolboom - Helmer Aaviksoo + - Arman Hosseini (arman) - Hiromi Hishida (77web) - Matthieu Ouellette-Vachon (maoueh) - Michał Pipa (michal.pipa) @@ -190,11 +192,11 @@ Symfony is the result of the work of many people who made the code better - Tyson Andre - GDIBass - Samuel NELA (snela) - - Jérôme Parmentier (lctrs) + - Ben Davies (bendavies) + - Andreas Schempp (aschempp) - James Halsall (jaitsu) - Matthieu Napoli (mnapoli) - Florent Mata (fmata) - - Arman Hosseini - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) @@ -211,7 +213,6 @@ Symfony is the result of the work of many people who made the code better - DQNEO - Andre Rømcke (andrerom) - mcfedr (mcfedr) - - Ben Davies (bendavies) - Gary PEGEOT (gary-p) - Ruben Gonzalez (rubenrua) - Benjamin Dulau (dbenjamin) @@ -221,6 +222,7 @@ Symfony is the result of the work of many people who made the code better - Andreas Hucks (meandmymonkey) - Tom Van Looy (tvlooy) - Noel Guilbert (noel) + - Anthony GRASSIOT (antograssiot) - Stadly - Stepan Anchugov (kix) - bronze1man @@ -243,21 +245,24 @@ Symfony is the result of the work of many people who made the code better - Dustin Whittle (dustinwhittle) - jeff - John Kary (johnkary) - - Andreas Schempp (aschempp) + - Jan Rosier (rosier) - Justin Hileman (bobthecow) - Blanchon Vincent (blanchonvincent) - Michele Orselli (orso) - Sven Paulus (subsven) - Maxime Veber (nek-) - - Anthony GRASSIOT (antograssiot) - Rui Marinho (ruimarinho) - Eugene Wissner + - Edi Modrić (emodric) - Pascal Montoya - Julien Brochet (mewt) - Leo Feyer - Tristan Darricau (nicofuma) - Victor Bocharsky (bocharsky_bw) + - Tomas Norkūnas (norkunas) - Marcel Beerta (mazen) + - Ruud Kamphuis (ruudk) + - Antoine Makdessi (amakdessi) - Maxime Helias (maxhelias) - Pavel Batanov (scaytrase) - Mantis Development @@ -271,6 +276,7 @@ Symfony is the result of the work of many people who made the code better - Lorenz Schori - Sébastien Lavoie (lavoiesl) - Dariusz + - Dmitrii Poddubnyi (karser) - Michael Babker (mbabker) - Francois Zaninotto - Alexander Kotynia (olden) @@ -279,11 +285,13 @@ Symfony is the result of the work of many people who made the code better - Marcos Sánchez - Elnur Abdurrakhimov (elnur) - Manuel Reinhard (sprain) + - Tien Vo (tienvx) - Danny Berger (dpb587) - Antonio J. García Lagar (ajgarlag) - Adam Prager (padam87) - Przemysław Bogusz (przemyslaw-bogusz) - Benoît Burnichon (bburnichon) + - Maciej Malarz (malarzm) - Roman Marintšenko (inori) - Xavier Montaña Carreras (xmontana) - Rémon van de Kamp (rpkamp) @@ -299,14 +307,12 @@ Symfony is the result of the work of many people who made the code better - Jordan Samouh (jordansamouh) - Baptiste Lafontaine (magnetik) - Jakub Kucharovic (jkucharovic) - - Edi Modrić (emodric) - Uwe Jäger (uwej711) - Eugene Leonovich (rybakit) - Filippo Tessarotto - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) - GordonsLondon - - Tomas Norkūnas (norkunas) - Quynh Xuan Nguyen (xuanquynh) - Jan Sorgalla (jsor) - Ray @@ -314,7 +320,6 @@ Symfony is the result of the work of many people who made the code better - Chekote - François Pluchino (francoispluchino) - Christopher Hertel (chertel) - - Antoine Makdessi (amakdessi) - Thomas Adam - Jhonny Lidfors (jhonne) - Diego Agulló (aeoris) @@ -335,7 +340,6 @@ Symfony is the result of the work of many people who made the code better - Zan Baldwin (zanderbaldwin) - Roumen Damianoff (roumen) - Kim Hemsø Rasmussen (kimhemsoe) - - Dmitrii Poddubnyi (karser) - Pascal Luna (skalpa) - Wouter Van Hecke - Peter Kruithof (pkruithof) @@ -348,6 +352,7 @@ Symfony is the result of the work of many people who made the code better - Christian Schmidt - Patrick Landolt (scube) - MatTheCat + - Loick Piera (pyrech) - David Badura (davidbadura) - Chad Sikorra (chadsikorra) - Chris Smith (cs278) @@ -368,7 +373,6 @@ Symfony is the result of the work of many people who made the code better - Jerzy Zawadzki (jzawadzki) - Wouter J - Ismael Ambrosi (iambrosi) - - Ruud Kamphuis (ruudk) - Emmanuel BORGES (eborges78) - Aurelijus Valeiša (aurelijus) - Jan Decavele (jandc) @@ -390,6 +394,7 @@ Symfony is the result of the work of many people who made the code better - Thierry Thuon (lepiaf) - Ricard Clau (ricardclau) - Mark Challoner (markchalloner) + - Philippe Segatori - Gennady Telegin (gtelegin) - Erin Millard - Artur Melo (restless) @@ -398,12 +403,12 @@ Symfony is the result of the work of many people who made the code better - Thomas Royer (cydonia7) - Nicolas LEFEVRE (nicoweb) - alquerci + - Olivier Dolbeau (odolbeau) - Mateusz Sip (mateusz_sip) - Francesco Levorato - Vitaliy Zakharov (zakharovvi) - Tobias Sjösten (tobiassjosten) - Gyula Sallai (salla) - - Maciej Malarz (malarzm) - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Dmytro Borysovskyi (dmytr0) @@ -415,13 +420,14 @@ Symfony is the result of the work of many people who made the code better - Felix Labrecque - Yaroslav Kiliba - Terje Bråten - - Tien Vo (tienvx) - Robbert Klarenbeek (robbertkl) - Eric Masoero (eric-masoero) - JhonnyL - hossein zolfi (ocean) - Clément Gautier (clementgautier) + - Bastien Jaillot (bastnic) - Dāvis Zālītis (k0d3r1s) + - Emanuele Panzeri (thepanz) - Sanpi - Eduardo Gulias (egulias) - giulio de donato (liuggio) @@ -437,6 +443,7 @@ Symfony is the result of the work of many people who made the code better - Alex Bowers - Philipp Cordes - Costin Bereveanu (schniper) + - Vilius Grigaliūnas - Loïc Chardonnet (gnusat) - Marek Kalnik (marekkalnik) - Vyacheslav Salakhutdinov (megazoll) @@ -446,9 +453,11 @@ Symfony is the result of the work of many people who made the code better - Michele Locati - Pavel Volokitin (pvolok) - Valentine Boineau (valentineboineau) + - Benjamin Leveque (benji07) - Arthur de Moulins (4rthem) - Matthias Althaus (althaus) - Nicolas Dewez (nicolas_dewez) + - Saif Eddin G - Endre Fejes - Tobias Naumann (tna) - Daniel Beyer @@ -461,7 +470,6 @@ Symfony is the result of the work of many people who made the code better - Lee Rowlands - Krzysztof Piasecki (krzysztek) - Maximilian Reichel (phramz) - - Loick Piera (pyrech) - Alain Hippolyte (aloneh) - Grenier Kévin (mcsky_biig) - Karoly Negyesi (chx) @@ -484,6 +492,7 @@ Symfony is the result of the work of many people who made the code better - Sébastien Santoro (dereckson) - Brian King - Michel Salib (michelsalib) + - Chris Tanaskoski - geoffrey - Steffen Roßkamp - Alexandru Furculita (afurculita) @@ -494,6 +503,7 @@ Symfony is the result of the work of many people who made the code better - Christopher Davis (chrisguitarguy) - Webnet team (webnet) - Farhad Safarov + - Jeroen Spee (jeroens) - Jan Schumann - Niklas Fiekas - Markus Bachmann (baachi) @@ -502,8 +512,7 @@ Symfony is the result of the work of many people who made the code better - Mihai Stancu - Ivan Nikolaev (destillat) - Gildas Quéméner (gquemener) - - Olivier Dolbeau (odolbeau) - - Jan Rosier (rosier) + - Oleg Andreyev - Alessandro Lai (jean85) - Desjardins Jérôme (jewome62) - Arturs Vonda @@ -543,7 +552,7 @@ Symfony is the result of the work of many people who made the code better - Gintautas Miselis - Rob Bast - Roberto Espinoza (respinoza) - - Emanuele Panzeri (thepanz) + - Alan Poulain - Soufian EZ-ZANTAR (soezz) - Zander Baldwin - Gocha Ossinkine (ossinkine) @@ -602,7 +611,6 @@ Symfony is the result of the work of many people who made the code better - Jakub Škvára (jskvara) - Andrew Udvare (audvare) - alexpods - - Saif Eddin G - Johann Pardanaud - Adam Szaraniec (mimol) - Dariusz Ruminski @@ -620,7 +628,6 @@ Symfony is the result of the work of many people who made the code better - Nils Adermann (naderman) - Gábor Fási - DUPUCH (bdupuch) - - Benjamin Leveque (benji07) - Nate (frickenate) - Timothée Barray (tyx) - jhonnyL @@ -661,20 +668,22 @@ Symfony is the result of the work of many people who made the code better - Disquedur - Michiel Boeckaert (milio) - Geoffrey Tran (geoff) + - Pablo Lozano (arkadis) - Kyle - Jan Behrens - Mantas Var (mvar) - - Chris Tanaskoski - Terje Bråten - Sebastian Krebs - Piotr Stankowski - Baptiste Leduc (bleduc) - Julien Maulny + - Sebastien Morel (plopix) - Jean-Christophe Cuvelier [Artack] - Julien Montel (julienmgel) - - Philippe Segatori - Simon DELICATA + - Artem Henvald (artemgenvald) - Dmitry Simushev + - Joe Bennett (kralos) - alcaeus - Fred Cox - vitaliytv @@ -690,7 +699,6 @@ Symfony is the result of the work of many people who made the code better - Kyle Evans (kevans91) - Charles-Henri Bruyand - Max Rath (drak3) - - Oleg Andreyev - Stéphane Escandell (sescandell) - Konstantin S. M. Möllers (ksmmoellers) - James Johnston @@ -754,6 +762,7 @@ Symfony is the result of the work of many people who made the code better - M. Vondano - Quentin de Longraye (quentinus95) - Chris Heng (gigablah) + - Islam93 - Shaun Simmons (simshaun) - Richard Bradley - Ulumuddin Yunus (joenoez) @@ -766,6 +775,7 @@ Symfony is the result of the work of many people who made the code better - Antoine Corcy - Ahmed Ashraf (ahmedash95) - Sascha Grossenbacher + - Alexander Menshchikov (zmey_kk) - Szijarto Tamas - Robin Lehrmann (robinlehrmann) - Catalin Dan @@ -818,7 +828,6 @@ Symfony is the result of the work of many people who made the code better - Michael Piecko - Toni Peric (tperic) - yclian - - Alan Poulain - Aleksey Prilipko - Andrew Berry - twifty @@ -830,11 +839,11 @@ Symfony is the result of the work of many people who made the code better - Dominik Ritter (dritter) - Dimitri Gritsajuk (ottaviano) - Sebastian Grodzicki (sgrodzicki) + - Mohamed Gamal - Jeroen van den Enden (stoefke) - Pascal Helfenstein - Baldur Rensch (brensch) - Pierre Rineau - - Vilius Grigaliūnas - Vladyslav Petrovych - Alex Xandra Albert Sim - Carson Full @@ -843,6 +852,7 @@ Symfony is the result of the work of many people who made the code better - Yuen-Chi Lian - Tarjei Huse (tarjei) - Besnik Br + - Toni Rudolf (toooni) - Jose Gonzalez - Jonathan (jls-esokia) - Oleksii Zhurbytskyi @@ -851,6 +861,7 @@ Symfony is the result of the work of many people who made the code better - Claudio Zizza - Dave Marshall (davedevelopment) - Jakub Kulhan (jakubkulhan) + - Shaharia Azam - avorobiev - Grégoire Penverne (gpenverne) - Venu @@ -896,6 +907,7 @@ Symfony is the result of the work of many people who made the code better - Franco Traversaro (belinde) - Francis Turmel (fturmel) - Nikita Nefedov (nikita2206) + - Alex Bacart - cgonzalez - Ben - Vincent Composieux (eko) @@ -919,6 +931,7 @@ Symfony is the result of the work of many people who made the code better - Reen Lokum - Andreas Möller (localheinz) - Martin Parsiegla (spea) + - Ivan - Quentin Schuler - Pierre Vanliefland (pvanliefland) - Roy Klutman (royklutman) @@ -969,6 +982,7 @@ Symfony is the result of the work of many people who made the code better - Derek ROTH - Ben Johnson - mweimerskirch + - Lctrs - Dmytro Boiko (eagle) - Shin Ohno (ganchiku) - Geert De Deckere (geertdd) @@ -1009,6 +1023,7 @@ Symfony is the result of the work of many people who made the code better - Marcos Gómez Vilches (markitosgv) - Matthew Davis (mdavis1982) - Markus S. (staabm) + - Guilliam Xavier - Maks - Antoine LA - den @@ -1030,14 +1045,12 @@ Symfony is the result of the work of many people who made the code better - Benoît Merlet (trompette) - Koen Kuipers - datibbaw - - Pablo Lozano (arkadis) - Erik Saunier (snickers) - Rootie - Daniel Alejandro Castro Arellano (lexcast) - sensio - Thomas Jarrand - Antoine Bluchet (soyuka) - - Sebastien Morel (plopix) - Patrick Kaufmann - Anton Dyshkant - Reece Fowell (reecefowell) @@ -1152,6 +1165,7 @@ Symfony is the result of the work of many people who made the code better - AKeeman (akeeman) - Mert Simsek (mrtsmsk0) - Lin Clark + - Meneses (c77men) - Jeremy David (jeremy.david) - Jordi Rejas - Troy McCabe @@ -1185,6 +1199,7 @@ Symfony is the result of the work of many people who made the code better - HypeMC - jfcixmedia - Dominic Tubach + - Nicolas Philippe (nikophil) - Nikita Konstantinov - Martijn Evers - Vitaliy Ryaboy (vitaliy) @@ -1241,7 +1256,9 @@ Symfony is the result of the work of many people who made the code better - e-ivanov - Michał (bambucha15) - Einenlum + - Jérémy Jarrié (gagnar) - Jochen Bayer (jocl) + - Michel Roca (mroca) - Patrick Carlo-Hickman - Bruno MATEU - Jeremy Bush @@ -1274,14 +1291,17 @@ Symfony is the result of the work of many people who made the code better - rchoquet - gitlost - Taras Girnyk + - Rémi Leclerc - Jan Vernarsky - Amine Yakoubi - Eduardo García Sanz (coma) - Sergio (deverad) - James Gilliland - fduch (fduch) + - Stuart Fyfe - David de Boer (ddeboer) - Eno Mullaraj (emullaraj) + - Nathan PAGE (nathix) - Ryan Rogers - Klaus Purer - arnaud (arnooo999) @@ -1404,6 +1424,7 @@ Symfony is the result of the work of many people who made the code better - Walter Dal Mut (wdalmut) - abluchet - Ruud Arentsen + - Ahmed Raafat - Harald Tollefsen - Matthieu - Albin Kerouaton @@ -1431,6 +1452,7 @@ Symfony is the result of the work of many people who made the code better - Constantine Shtompel - Jules Lamur - Renato Mendes Figueiredo + - Benjamin RICHARD - pdommelen - Eric Stern - ShiraNai7 @@ -1453,8 +1475,9 @@ Symfony is the result of the work of many people who made the code better - m.chwedziak - Andreas Frömer - Philip Frank + - David Brooks - Lance McNearney - - Jeroen Spee (jeroens) + - Guillaume Verstraete - Giorgio Premi - ncou - Ian Carroll @@ -1466,7 +1489,6 @@ Symfony is the result of the work of many people who made the code better - Tom Corrigan (tomcorrigan) - Luis Galeas - Martin Pärtel - - Bastien Jaillot (bastnic) - Daniel Rotter (danrot) - Frédéric Bouchery (fbouchery) - Patrick Daley (padrig) @@ -1475,7 +1497,6 @@ Symfony is the result of the work of many people who made the code better - WedgeSama - Felds Liscia - Chihiro Adachi (chihiro-adachi) - - Alex Bacart - Raphaëll Roussel - Tadcka - Beth Binkovitz @@ -1504,6 +1525,7 @@ Symfony is the result of the work of many people who made the code better - Mathieu Morlon - Daniel Tschinder - Arnaud CHASSEUX + - tuqqu - Wojciech Gorczyca - Rafał Muszyński (rafmus90) - Sébastien Decrême (sebdec) @@ -1563,8 +1585,10 @@ Symfony is the result of the work of many people who made the code better - Patrik Gmitter (patie) - Peter Schultz - Jonathan Gough + - Benhssaein Youssef - Benjamin Bender - Jared Farrish + - Trevor North - karl.rixon - raplider - Konrad Mohrfeldt @@ -1636,6 +1660,7 @@ Symfony is the result of the work of many people who made the code better - Francisco Facioni (fran6co) - Stanislav Gamayunov (happyproff) - Iwan van Staveren (istaveren) + - Alexander McCullagh (mccullagh) - Povilas S. (povilas) - Laurent Negre (raulnet) - Evrard Boulou @@ -1772,6 +1797,7 @@ Symfony is the result of the work of many people who made the code better - JakeFr - Simon Sargeant - efeen + - Jan Christoph Beyer - Nicolas Pion - Muhammed Akbulut - Roy-Orbison @@ -1785,6 +1811,7 @@ Symfony is the result of the work of many people who made the code better - Johannes Müller (johmue) - Jordi Llonch (jordillonch) - Nicholas Ruunu (nicholasruunu) + - Jeroen van den Nieuwenhuisen (nieuwenhuisen) - Cyril Pascal (paxal) - Cédric Dugat (ph3nol) - Philip Dahlstrøm (phidah) @@ -1825,10 +1852,10 @@ Symfony is the result of the work of many people who made the code better - Dmitry Korotovsky - mcorteel - Michael van Tricht - - Ivan - ReScO - Tim Strehle - Sam Ward + - Michael Voříšek - Walther Lalk - Adam - Ivo @@ -1840,7 +1867,6 @@ Symfony is the result of the work of many people who made the code better - gedrox - Bohan Yang - Alan Bondarchuk - - Joe Bennett - dropfen - Andrey Chernykh - Edvinas Klovas @@ -1858,6 +1884,7 @@ Symfony is the result of the work of many people who made the code better - thib92 - Rudolf Ratusiński - Bertalan Attila + - Rafael Tovar - Amin Hosseini (aminh) - AmsTaFF (amstaff) - Simon Müller (boscho) @@ -1872,10 +1899,13 @@ Symfony is the result of the work of many people who made the code better - Jan Marek (janmarek) - Mark de Haan (markdehaan) - Dan Patrick (mdpatrick) + - naitsirch (naitsirch) - Geoffrey Monte (numerogeek) + - Martijn Boers (plebian) - Pedro Magalhães (pmmaga) - Rares Vlaseanu (raresvla) - tante kinast (tante) + - Stephen Lewis (tehanomalousone) - Ahmed Hannachi (tiecoders) - Vincent LEFORT (vlefort) - Walid BOUGHDIRI (walidboughdiri) @@ -1982,7 +2012,6 @@ Symfony is the result of the work of many people who made the code better - Klaas Naaijkens - Daniel González Cerviño - Rafał - - Lctrs - Achilles Kaloeridis (achilles) - Adria Lopez (adlpz) - Aaron Scherer (aequasi) @@ -1993,8 +2022,10 @@ Symfony is the result of the work of many people who made the code better - Masao Maeda (brtriver) - Darius Leskauskas (darles) - david perez (davidpv) + - Daniël Brekelmans (dbrekelmans) - David Joos (djoos) - Denis Klementjev (dklementjev) + - Dominik Pesch (dombn) - Dominik Hajduk (dominikalp) - Tomáš Polívka (draczris) - Dennis Smink (dsmink) @@ -2005,6 +2036,7 @@ Symfony is the result of the work of many people who made the code better - Gusakov Nikita (hell0w0rd) - Yannick Ihmels (ihmels) - Osman Üngür (import) + - Jaap van Otterdijk (jaapio) - Javier Núñez Berrocoso (javiernuber) - Jelle Bekker (jbekker) - Giovanni Albero (johntree) @@ -2021,6 +2053,7 @@ Symfony is the result of the work of many people who made the code better - Marek Šimeček (mssimi) - Dmitriy Tkachenko (neka) - Cayetano Soriano Gallego (neoshadybeat) + - Artem (nexim) - Olivier Laviale (olvlvl) - Ondrej Machulda (ondram) - Pierre Gasté (pierre_g) @@ -2036,6 +2069,7 @@ Symfony is the result of the work of many people who made the code better - Angel Fernando Quiroz Campos - Ondrej Mirtes - akimsko + - Stefan Kruppa - Youpie - srsbiz - Taylan Kasap @@ -2075,6 +2109,7 @@ Symfony is the result of the work of many people who made the code better - Till Klampaeckel (till) - Tobias Weinert (tweini) - Ulf Reimers (ureimers) + - Morten Wulff (wulff) - Wotre - goohib - Tom Counsell @@ -2095,7 +2130,6 @@ Symfony is the result of the work of many people who made the code better - Benjamin Morel - Eric Grimois - Piers Warmers - - Guilliam Xavier - Sylvain Lorinet - klyk50 - Andreas Lutro @@ -2235,10 +2269,12 @@ Symfony is the result of the work of many people who made the code better - Oussama Elgoumri - Dawid Nowak - Lesnykh Ilia + - sabruss - darnel - Karolis Daužickas - Nicolas - Sergio Santoro + - Dmitriy Derepko - tirnanog06 - phc - Дмитрий Пацура @@ -2283,6 +2319,7 @@ Symfony is the result of the work of many people who made the code better - Carsten Eilers (fnc) - Sorin Gitlan (forapathy) - Yohan Giarelli (frequence-web) + - Jesse Rushlow (geeshoe) - Gerry Vandermaesen (gerryvdm) - Ghazy Ben Ahmed (ghazy) - Arash Tabriziyan (ghost098) @@ -2317,6 +2354,7 @@ Symfony is the result of the work of many people who made the code better - Michal Čihař (mcihar) - Matt Drollette (mdrollette) - Adam Monsen (meonkeys) + - diego aguiar (mollokhan) - Hugo Monteiro (monteiro) - Ala Eddine Khefifi (nayzo) - emilienbouard (neime) @@ -2332,6 +2370,7 @@ Symfony is the result of the work of many people who made the code better - Philipp Hoffmann (philipphoffmann) - Alex Carol (picard89) - Daniel Perez Pinazo (pitiflautico) + - Igor Tarasov (polosatus) - Phil Taylor (prazgod) - Maxim Pustynnikov (pustynnikov) - Ralf Kuehnel (ralfkuehnel) @@ -2365,7 +2404,6 @@ Symfony is the result of the work of many people who made the code better - Wouter Sioen (wouter_sioen) - Xavier Amado (xamado) - Jesper Søndergaard Pedersen (zerrvox) - - Alexander Menshchikov (zmey_kk) - Florent Cailhol - szymek - Ryan Linnit @@ -2377,6 +2415,7 @@ Symfony is the result of the work of many people who made the code better - MaPePeR - Andreas Streichardt - Alexandre Segura + - Vivien - Pascal Hofmann - david-binda - smokeybear87 @@ -2389,6 +2428,7 @@ Symfony is the result of the work of many people who made the code better - Sergey Fedotov - Konstantin Scheumann - Michael + - Nate Wiebe - fh-github@fholzhauer.de - AbdElKader Bouadjadja - DSeemiller @@ -2400,6 +2440,7 @@ Symfony is the result of the work of many people who made the code better - max - Alexander Bauer (abauer) - Ahmad Mayahi (ahmadmayahi) + - Alireza Mirsepassi (alirezamirsepassi) - Mohamed Karnichi (amiral) - Andrew Carter (andrewcarteruk) - Adam Elsodaney (archfizz) diff --git a/phpunit b/phpunit index 200a9c28b4c34..c89d2e400b602 100755 --- a/phpunit +++ b/phpunit @@ -1,7 +1,7 @@ #!/usr/bin/env php container->get($name); if (!$manager instanceof LazyLoadingInterface) { - throw new \LogicException('Resetting a non-lazy manager service is not supported. '.(interface_exists(LazyLoadingInterface::class) ? sprintf('Declare the "%s" service as lazy.', $name) : 'Try running "composer require symfony/proxy-manager-bridge".')); + throw new \LogicException('Resetting a non-lazy manager service is not supported. '.(interface_exists(LazyLoadingInterface::class) && class_exists(RuntimeInstantiator::class) ? sprintf('Declare the "%s" service as lazy.', $name) : 'Try running "composer require symfony/proxy-manager-bridge".')); } $manager->setProxyInitializer(\Closure::bind( function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) { diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php index 50873b612aa71..bf38110e68662 100644 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php @@ -10,7 +10,7 @@ */ // Please update when phpunit needs to be reinstalled with fresh deps: -// Cache-Id: 2019-09-19 17:00 UTC +// Cache-Id: 2020-01-31 10:00 UTC error_reporting(-1); @@ -24,15 +24,47 @@ static $phpunitConfig = null; if (null === $phpunitConfig) { - $opt = min(array_search('-c', $opts = array_reverse($argv), true) ?: INF, array_search('--configuration', $opts, true) ?: INF); $phpunitConfigFilename = null; - if (INF !== $opt && isset($opts[$opt - 1])) { - $phpunitConfigFilename = $opts[$opt - 1]; - } elseif (file_exists('phpunit.xml')) { - $phpunitConfigFilename = 'phpunit.xml'; - } elseif (file_exists('phpunit.xml.dist')) { - $phpunitConfigFilename = 'phpunit.xml.dist'; + $getPhpUnitConfig = function ($probableConfig) use (&$getPhpUnitConfig) { + if (!$probableConfig) { + return null; + } + if (is_dir($probableConfig)) { + return $getPhpUnitConfig($probableConfig.DIRECTORY_SEPARATOR.'phpunit.xml'); + } + + if (file_exists($probableConfig)) { + return $probableConfig; + } + if (file_exists($probableConfig.'.dist')) { + return $probableConfig.'.dist'; + } + + return null; + }; + + foreach ($argv as $cliArgumentIndex => $cliArgument) { + if ('--' === $cliArgument) { + break; + } + // long option + if ('--configuration' === $cliArgument && array_key_exists($cliArgumentIndex + 1, $argv)) { + $phpunitConfigFilename = $getPhpUnitConfig($argv[$cliArgumentIndex + 1]); + break; + } + // short option + if (0 === strpos($cliArgument, '-c')) { + if ('-c' === $cliArgument && array_key_exists($cliArgumentIndex + 1, $argv)) { + $phpunitConfigFilename = $getPhpUnitConfig($argv[$cliArgumentIndex + 1]); + } else { + $phpunitConfigFilename = $getPhpUnitConfig(substr($cliArgument, 2)); + } + break; + } } + + $phpunitConfigFilename = $phpunitConfigFilename ?: $getPhpUnitConfig('phpunit.xml'); + if ($phpunitConfigFilename) { $phpunitConfig = new DomDocument(); $phpunitConfig->load($phpunitConfigFilename); diff --git a/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php b/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php index 8056090110c41..f4cad03fe18f1 100644 --- a/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php +++ b/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php @@ -25,9 +25,9 @@ class DefaultMarshaller implements MarshallerInterface public function __construct(bool $useIgbinarySerialize = null) { if (null === $useIgbinarySerialize) { - $useIgbinarySerialize = \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400; - } elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || \PHP_VERSION_ID >= 70400)) { - throw new CacheException('The "igbinary" PHP extension is not '.(\PHP_VERSION_ID >= 70400 ? 'compatible with PHP 7.4.' : 'loaded.')); + $useIgbinarySerialize = \extension_loaded('igbinary') && (\PHP_VERSION_ID < 70400 || version_compare('3.1.0', phpversion('igbinary'), '<=')); + } elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')))) { + throw new CacheException(\extension_loaded('igbinary') && \PHP_VERSION_ID >= 70400 ? 'Please upgrade the "igbinary" PHP extension to v3.1 or higher.' : 'The "igbinary" PHP extension is not loaded.'); } $this->useIgbinarySerialize = $useIgbinarySerialize; } @@ -66,7 +66,7 @@ public function unmarshall(string $value) return null; } static $igbinaryNull; - if ($value === ($igbinaryNull ?? $igbinaryNull = \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400 ? igbinary_serialize(null) : false)) { + if ($value === ($igbinaryNull ?? $igbinaryNull = \extension_loaded('igbinary') && (\PHP_VERSION_ID < 70400 || version_compare('3.1.0', phpversion('igbinary'), '<=')) ? igbinary_serialize(null) : false)) { return null; } $unserializeCallbackHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback'); diff --git a/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php b/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php index cc94ad15237a0..aaef04610e457 100644 --- a/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php +++ b/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php @@ -24,7 +24,7 @@ public function testSerialize() 'b' => function () {}, ]; - $expected = ['a' => \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400 ? igbinary_serialize(123) : serialize(123)]; + $expected = ['a' => \extension_loaded('igbinary') && (\PHP_VERSION_ID < 70400 || version_compare('3.1.0', phpversion('igbinary'), '<=')) ? igbinary_serialize(123) : serialize(123)]; $this->assertSame($expected, $marshaller->marshall($values, $failed)); $this->assertSame(['b'], $failed); } @@ -43,7 +43,7 @@ public function testNativeUnserialize() */ public function testIgbinaryUnserialize() { - if (\PHP_VERSION_ID >= 70400) { + if (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')) { $this->markTestSkipped('igbinary is not compatible with PHP 7.4.'); } @@ -67,7 +67,7 @@ public function testNativeUnserializeNotFoundClass() */ public function testIgbinaryUnserializeNotFoundClass() { - if (\PHP_VERSION_ID >= 70400) { + if (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')) { $this->markTestSkipped('igbinary is not compatible with PHP 7.4.'); } @@ -95,7 +95,7 @@ public function testNativeUnserializeInvalid() */ public function testIgbinaryUnserializeInvalid() { - if (\PHP_VERSION_ID >= 70400) { + if (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')) { $this->markTestSkipped('igbinary is not compatible with PHP 7.4.'); } diff --git a/src/Symfony/Component/Cache/Traits/PdoTrait.php b/src/Symfony/Component/Cache/Traits/PdoTrait.php index b636e7565b2cd..3294f1fe50d66 100644 --- a/src/Symfony/Component/Cache/Traits/PdoTrait.php +++ b/src/Symfony/Component/Cache/Traits/PdoTrait.php @@ -395,6 +395,7 @@ private function getConnection() } else { switch ($this->driver = $this->conn->getDriver()->getName()) { case 'mysqli': + throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this))); case 'pdo_mysql': case 'drizzle_pdo_mysql': $this->driver = 'mysql'; diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index e9d80d76d9be1..d23871f5acfbd 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -796,7 +796,7 @@ protected function doRenderException(\Exception $e, OutputInterface $output) } if (false !== strpos($message, "class@anonymous\0")) { - $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $message); } diff --git a/src/Symfony/Component/Debug/Exception/FlattenException.php b/src/Symfony/Component/Debug/Exception/FlattenException.php index 71dc4febfc9c0..5dbf64db80912 100644 --- a/src/Symfony/Component/Debug/Exception/FlattenException.php +++ b/src/Symfony/Component/Debug/Exception/FlattenException.php @@ -172,7 +172,7 @@ public function getMessage() public function setMessage($message) { if (false !== strpos($message, "class@anonymous\0")) { - $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $message); } diff --git a/src/Symfony/Component/HttpClient/HttpClientTrait.php b/src/Symfony/Component/HttpClient/HttpClientTrait.php index 2914ab20b6022..298ebc741b940 100644 --- a/src/Symfony/Component/HttpClient/HttpClientTrait.php +++ b/src/Symfony/Component/HttpClient/HttpClientTrait.php @@ -86,7 +86,7 @@ private static function prepareRequest(?string $method, ?string $url, array $opt throw new InvalidArgumentException(sprintf('Option "auth_basic" must be string or an array, %s given.', \gettype($options['auth_basic']))); } - if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._~+/0-9a-zA-Z]++=*+$}', $options['auth_bearer']))) { + if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._=~+/0-9a-zA-Z]++$}', $options['auth_bearer']))) { throw new InvalidArgumentException(sprintf('Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, %s given.', \is_string($options['auth_bearer']) ? 'invalid string' : \gettype($options['auth_bearer']))); } diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 1e616453c92db..4e70b95e29ff9 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -628,7 +628,7 @@ public function isImmutable(): bool } /** - * Returns true if the response must be revalidated by caches. + * Returns true if the response must be revalidated by shared caches once it has become stale. * * This method indicates that the response must not be served stale by a * cache in any circumstance without first revalidating with the origin. diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 19ad79fca29b2..c46ae11362039 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -482,13 +482,37 @@ protected function forward(Request $request, $catch = false, Response $entry = n // always a "master" request (as the real master request can be in cache) $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, $catch); - // we don't implement the stale-if-error on Requests, which is nonetheless part of the RFC - if (null !== $entry && \in_array($response->getStatusCode(), [500, 502, 503, 504])) { + /* + * Support stale-if-error given on Responses or as a config option. + * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual + * Cache-Control directives) that + * + * A cache MUST NOT generate a stale response if it is prohibited by an + * explicit in-protocol directive (e.g., by a "no-store" or "no-cache" + * cache directive, a "must-revalidate" cache-response-directive, or an + * applicable "s-maxage" or "proxy-revalidate" cache-response-directive; + * see Section 5.2.2). + * + * https://tools.ietf.org/html/rfc7234#section-4.2.4 + * + * We deviate from this in one detail, namely that we *do* serve entries in the + * stale-if-error case even if they have a `s-maxage` Cache-Control directive. + */ + if (null !== $entry + && \in_array($response->getStatusCode(), [500, 502, 503, 504]) + && !$entry->headers->hasCacheControlDirective('no-cache') + && !$entry->mustRevalidate() + ) { if (null === $age = $entry->headers->getCacheControlDirective('stale-if-error')) { $age = $this->options['stale_if_error']; } - if (abs($entry->getTtl()) < $age) { + /* + * stale-if-error gives the (extra) time that the Response may be used *after* it has become stale. + * So we compare the time the $entry has been sitting in the cache already with the + * time it was fresh plus the allowed grace period. + */ + if ($entry->getAge() <= $entry->getMaxAge() + $age) { $this->record($request, 'stale-if-error'); return $entry; diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 9c31bbbd3f8d3..a5f711805b5cd 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,11 +73,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.3.10'; - const VERSION_ID = 40310; + const VERSION = '4.3.11'; + const VERSION_ID = 40311; const MAJOR_VERSION = 4; const MINOR_VERSION = 3; - const RELEASE_VERSION = 10; + const RELEASE_VERSION = 11; const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2020'; diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php index ca2e03ebc57fc..e2b9d908047ef 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php @@ -1524,6 +1524,168 @@ public function testUsesOriginalRequestForSurrogate() $cache->handle($request, HttpKernelInterface::SUB_REQUEST); } + public function testStaleIfErrorMustNotResetLifetime() + { + // Make sure we don't accidentally treat the response as fresh (revalidated) again + // when stale-if-error handling kicks in. + + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + // This is cacheable and can be used in stale-if-error cases: + 'headers' => ['Cache-Control' => 'public, max-age=10', 'ETag' => 'some-etag'], + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; + + $this->request('GET', '/'); // warm cache + + sleep(15); // now the entry is stale, but still within the grace period (10s max-age + 10s stale-if-error) + + $this->request('GET', '/'); // hit backend error + $this->assertEquals(200, $this->response->getStatusCode()); // stale-if-error saved the day + $this->assertEquals(15, $this->response->getAge()); + + sleep(10); // now we're outside the grace period + + $this->request('GET', '/'); // hit backend error + $this->assertEquals(500, $this->response->getStatusCode()); // fail + } + + /** + * @dataProvider getResponseDataThatMayBeServedStaleIfError + */ + public function testResponsesThatMayBeUsedStaleIfError($responseHeaders, $sleepBetweenRequests = null) + { + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + 'headers' => $responseHeaders, + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; // after stale, may be served for 10s + + $this->request('GET', '/'); // warm cache + + if ($sleepBetweenRequests) { + sleep($sleepBetweenRequests); + } + + $this->request('GET', '/'); // hit backend error + + $this->assertEquals(200, $this->response->getStatusCode()); + $this->assertEquals('OK', $this->response->getContent()); + $this->assertTraceContains('stale-if-error'); + } + + public function getResponseDataThatMayBeServedStaleIfError() + { + // All data sets assume that a 10s stale-if-error grace period has been configured + yield 'public, max-age expired' => [['Cache-Control' => 'public, max-age=60'], 65]; + yield 'public, validateable with ETag, no TTL' => [['Cache-Control' => 'public', 'ETag' => 'some-etag'], 5]; + yield 'public, validateable with Last-Modified, no TTL' => [['Cache-Control' => 'public', 'Last-Modified' => 'yesterday'], 5]; + yield 'public, s-maxage will be served stale-if-error, even if the RFC mandates otherwise' => [['Cache-Control' => 'public, s-maxage=20'], 25]; + } + + /** + * @dataProvider getResponseDataThatMustNotBeServedStaleIfError + */ + public function testResponsesThatMustNotBeUsedStaleIfError($responseHeaders, $sleepBetweenRequests = null) + { + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + 'headers' => $responseHeaders, + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; // after stale, may be served for 10s + $this->cacheConfig['strict_smaxage'] = true; // full RFC compliance for this feature + + $this->request('GET', '/'); // warm cache + + if ($sleepBetweenRequests) { + sleep($sleepBetweenRequests); + } + + $this->request('GET', '/'); // hit backend error + + $this->assertEquals(500, $this->response->getStatusCode()); + } + + public function getResponseDataThatMustNotBeServedStaleIfError() + { + // All data sets assume that a 10s stale-if-error grace period has been configured + yield 'public, no TTL but beyond grace period' => [['Cache-Control' => 'public'], 15]; + yield 'public, validateable with ETag, no TTL but beyond grace period' => [['Cache-Control' => 'public', 'ETag' => 'some-etag'], 15]; + yield 'public, validateable with Last-Modified, no TTL but beyond grace period' => [['Cache-Control' => 'public', 'Last-Modified' => 'yesterday'], 15]; + yield 'public, stale beyond grace period' => [['Cache-Control' => 'public, max-age=10'], 30]; + + // Cache-control values that prohibit serving stale responses or responses without positive validation - + // see https://tools.ietf.org/html/rfc7234#section-4.2.4 and + // https://tools.ietf.org/html/rfc7234#section-5.2.2 + yield 'no-cache requires positive validation' => [['Cache-Control' => 'public, no-cache', 'ETag' => 'some-etag']]; + yield 'no-cache requires positive validation, even if fresh' => [['Cache-Control' => 'public, no-cache, max-age=10']]; + yield 'must-revalidate requires positive validation once stale' => [['Cache-Control' => 'public, max-age=10, must-revalidate'], 15]; + yield 'proxy-revalidate requires positive validation once stale' => [['Cache-Control' => 'public, max-age=10, proxy-revalidate'], 15]; + } + + public function testStaleIfErrorWhenStrictSmaxageDisabled() + { + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + 'headers' => ['Cache-Control' => 'public, s-maxage=20'], + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; + $this->cacheConfig['strict_smaxage'] = false; + + $this->request('GET', '/'); // warm cache + sleep(25); + $this->request('GET', '/'); // hit backend error + + $this->assertEquals(200, $this->response->getStatusCode()); + $this->assertEquals('OK', $this->response->getContent()); + $this->assertTraceContains('stale-if-error'); + } + public function testTraceHeaderNameCanBeChanged() { $this->cacheConfig['trace_header'] = 'X-My-Header'; diff --git a/src/Symfony/Component/Lock/Store/PdoStore.php b/src/Symfony/Component/Lock/Store/PdoStore.php index 0cf3dd35f7a19..94ef6b1457027 100644 --- a/src/Symfony/Component/Lock/Store/PdoStore.php +++ b/src/Symfony/Component/Lock/Store/PdoStore.php @@ -307,6 +307,7 @@ private function getDriver(): string } else { switch ($this->driver = $con->getDriver()->getName()) { case 'mysqli': + throw new NotSupportedException(sprintf('The store "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this))); case 'pdo_mysql': case 'drizzle_pdo_mysql': $this->driver = 'mysql'; diff --git a/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php b/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php index 73cbfb6cb9578..604c497bfb250 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php @@ -207,7 +207,40 @@ public function testEncodedSkipsNonEncodeableStamps() $encoded = $serializer->encode($envelope); $this->assertStringNotContainsString('DummySymfonySerializerNonSendableStamp', print_r($encoded['headers'], true)); } + + public function testDecodingFailedConstructorDeserialization() + { + $serializer = new Serializer(); + + $this->expectException(MessageDecodingFailedException::class); + + $serializer->decode([ + 'body' => '{}', + 'headers' => ['type' => DummySymfonySerializerInvalidConstructor::class], + ]); + } + + public function testDecodingStampFailedDeserialization() + { + $serializer = new Serializer(); + + $this->expectException(MessageDecodingFailedException::class); + + $serializer->decode([ + 'body' => '{"message":"hello"}', + 'headers' => [ + 'type' => DummyMessage::class, + 'X-Message-Stamp-'.SerializerStamp::class => '[{}]', + ], + ]); + } } class DummySymfonySerializerNonSendableStamp implements NonSendableStampInterface { } +class DummySymfonySerializerInvalidConstructor +{ + public function __construct(string $missingArgument) + { + } +} diff --git a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php index f665e8b31c492..c0763eb157a1b 100644 --- a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php @@ -86,13 +86,13 @@ public static function buildConfiguration($dsn, array $options = []) // check for extra keys in options $optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS)); if (0 < \count($optionsExtraKeys)) { - throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', self::DEFAULT_OPTIONS))); + throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); } // check for extra keys in options $queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS)); if (0 < \count($queryExtraKeys)) { - throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', self::DEFAULT_OPTIONS))); + throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); } return $configuration; diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php index 3c13cb6e9038e..8d4b63994a669 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php @@ -19,7 +19,7 @@ use Symfony\Component\Messenger\Stamp\StampInterface; use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Encoder\XmlEncoder; -use Symfony\Component\Serializer\Exception\UnexpectedValueException; +use Symfony\Component\Serializer\Exception\ExceptionInterface; use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; use Symfony\Component\Serializer\Serializer as SymfonySerializer; @@ -81,7 +81,7 @@ public function decode(array $encodedEnvelope): Envelope try { $message = $this->serializer->deserialize($encodedEnvelope['body'], $encodedEnvelope['headers']['type'], $this->format, $context); - } catch (UnexpectedValueException $e) { + } catch (ExceptionInterface $e) { throw new MessageDecodingFailedException(sprintf('Could not decode message: %s.', $e->getMessage()), $e->getCode(), $e); } @@ -119,7 +119,7 @@ private function decodeStamps(array $encodedEnvelope): array try { $stamps[] = $this->serializer->deserialize($value, substr($name, \strlen(self::STAMP_HEADER_PREFIX)).'[]', $this->format, $this->context); - } catch (UnexpectedValueException $e) { + } catch (ExceptionInterface $e) { throw new MessageDecodingFailedException(sprintf('Could not decode stamp: %s.', $e->getMessage()), $e->getCode(), $e); } } diff --git a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php index 3bb55a2133245..c9afe42144f01 100644 --- a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php +++ b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php @@ -91,7 +91,7 @@ public function refreshUser(UserInterface $user) $e->setUsername($user->getUsername()); throw $e; } else { - throw new UnsupportedUserException(sprintf('The account "%s" is not supported.', \get_class($user))); + throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', \get_class($user))); } } diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index ce84e656f4cb0..02a61211eefd9 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -255,7 +255,7 @@ protected function refreshUser(TokenInterface $token) return null; } - throw new \RuntimeException(sprintf('There is no user provider for user "%s".', $userClass)); + throw new \RuntimeException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $userClass)); } private function safelyUnserialize($serializedToken) diff --git a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php index 00caffb02e7a7..fdb2dbaafa4a5 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php +++ b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php @@ -233,7 +233,7 @@ final protected function getUserProvider($class) } } - throw new UnsupportedUserException(sprintf('There is no user provider that supports class "%s".', $class)); + throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $class)); } /** diff --git a/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php b/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php index 74ecf02cf39c1..2a8d3f4f56eeb 100644 --- a/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php @@ -48,7 +48,13 @@ public function __construct(string $class, string $name) */ public function getPropertyValue($object) { - return $this->getReflectionMember($object)->getValue($object); + $reflProperty = $this->getReflectionMember($object); + + if (\PHP_VERSION_ID >= 70400 && !$reflProperty->isInitialized($object)) { + return null; + } + + return $reflProperty->getValue($object); } /** diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/Entity_74.php b/src/Symfony/Component/Validator/Tests/Fixtures/Entity_74.php new file mode 100644 index 0000000000000..cb22fb7f72410 --- /dev/null +++ b/src/Symfony/Component/Validator/Tests/Fixtures/Entity_74.php @@ -0,0 +1,8 @@ +expectException('Symfony\Component\Validator\Exception\ValidatorException'); $metadata->getPropertyValue($entity); } + + /** + * @requires PHP 7.4 + */ + public function testGetPropertyValueFromUninitializedProperty() + { + $entity = new Entity_74(); + $metadata = new PropertyMetadata(self::CLASSNAME_74, 'uninitialized'); + + $this->assertNull($metadata->getPropertyValue($entity)); + } } diff --git a/src/Symfony/Component/VarDumper/Caster/ClassStub.php b/src/Symfony/Component/VarDumper/Caster/ClassStub.php index afafda57530bc..60ecb99769a37 100644 --- a/src/Symfony/Component/VarDumper/Caster/ClassStub.php +++ b/src/Symfony/Component/VarDumper/Caster/ClassStub.php @@ -56,7 +56,7 @@ public function __construct(string $identifier, $callable = null) } if (false !== strpos($identifier, "class@anonymous\0")) { - $this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $identifier); } diff --git a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php index ad02aec2fe3b6..542472ebaf138 100644 --- a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php @@ -282,7 +282,7 @@ private static function filterExceptionArray($xClass, array $a, $xPrefix, $filte unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "class@anonymous\0")) { - $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $a[Caster::PREFIX_PROTECTED.'message']); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy