From 3a529e3391ab526ba9ea776fbd887573921b4eb1 Mon Sep 17 00:00:00 2001 From: Thomas Perez Date: Mon, 3 Jul 2017 15:09:40 +0200 Subject: [PATCH 01/33] Improve CircularReferenceException message --- .../Component/Serializer/Normalizer/AbstractNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php index 63bfb871e8..5149d0dbc7 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -228,7 +228,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N return call_user_func($this->circularReferenceHandler, $object); } - throw new CircularReferenceException(sprintf('A circular reference has been detected (configured limit: %d).', $this->circularReferenceLimit)); + throw new CircularReferenceException(sprintf('A circular reference has been detected when serializing the object of class "%s" (configured limit: %d)', get_class($object), $this->circularReferenceLimit)); } /** From 1d07a28beda7b2e9f2c18e13502ba8b293780f21 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 20 Jun 2017 19:01:50 +0200 Subject: [PATCH 02/33] call setContainer() for autowired controllers --- .../Controller/ControllerResolver.php | 14 +++- .../Controller/ControllerResolverTest.php | 69 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php index 355f526fdc..3de157bd4f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php @@ -49,7 +49,19 @@ class ControllerResolver extends ContainerControllerResolver $controller = $this->parser->parse($controller); } - return parent::createController($controller); + $resolvedController = parent::createController($controller); + + if (1 === substr_count($controller, ':') && is_array($resolvedController)) { + if ($resolvedController[0] instanceof ContainerAwareInterface) { + $resolvedController[0]->setContainer($this->container); + } + + if ($resolvedController[0] instanceof AbstractController && null !== $previousContainer = $resolvedController[0]->setContainer($this->container)) { + $resolvedController[0]->setContainer($previousContainer); + } + } + + return $resolvedController; } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php index 7946a96e8d..5880ee0186 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php @@ -13,6 +13,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; use Psr\Container\ContainerInterface as Psr11ContainerInterface; use Psr\Log\LoggerInterface; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver; use Symfony\Component\DependencyInjection\Container; @@ -68,6 +69,24 @@ class ControllerResolverTest extends ContainerControllerResolverTest $this->assertSame('testAction', $controller[1]); } + public function testContainerAwareControllerGetsContainerWhenNotSet() + { + class_exists(AbstractControllerTest::class); + + $controller = new ContainerAwareController(); + + $container = new Container(); + $container->set(TestAbstractController::class, $controller); + + $resolver = $this->createControllerResolver(null, $container); + + $request = Request::create('/'); + $request->attributes->set('_controller', TestAbstractController::class.':testAction'); + + $this->assertSame(array($controller, 'testAction'), $resolver->getController($request)); + $this->assertSame($container, $controller->getContainer()); + } + public function testAbstractControllerGetsContainerWhenNotSet() { class_exists(AbstractControllerTest::class); @@ -86,6 +105,24 @@ class ControllerResolverTest extends ContainerControllerResolverTest $this->assertSame($container, $controller->setContainer($container)); } + public function testAbstractControllerServiceWithFcqnIdGetsContainerWhenNotSet() + { + class_exists(AbstractControllerTest::class); + + $controller = new DummyController(); + + $container = new Container(); + $container->set(DummyController::class, $controller); + + $resolver = $this->createControllerResolver(null, $container); + + $request = Request::create('/'); + $request->attributes->set('_controller', DummyController::class.':fooAction'); + + $this->assertSame(array($controller, 'fooAction'), $resolver->getController($request)); + $this->assertSame($container, $controller->getContainer()); + } + public function testAbstractControllerGetsNoContainerWhenSet() { class_exists(AbstractControllerTest::class); @@ -106,6 +143,26 @@ class ControllerResolverTest extends ContainerControllerResolverTest $this->assertSame($controllerContainer, $controller->setContainer($container)); } + public function testAbstractControllerServiceWithFcqnIdGetsNoContainerWhenSet() + { + class_exists(AbstractControllerTest::class); + + $controller = new DummyController(); + $controllerContainer = new Container(); + $controller->setContainer($controllerContainer); + + $container = new Container(); + $container->set(DummyController::class, $controller); + + $resolver = $this->createControllerResolver(null, $container); + + $request = Request::create('/'); + $request->attributes->set('_controller', DummyController::class.':fooAction'); + + $this->assertSame(array($controller, 'fooAction'), $resolver->getController($request)); + $this->assertSame($controllerContainer, $controller->getContainer()); + } + protected function createControllerResolver(LoggerInterface $logger = null, Psr11ContainerInterface $container = null, ControllerNameParser $parser = null) { if (!$parser) { @@ -152,3 +209,15 @@ class ContainerAwareController implements ContainerAwareInterface { } } + +class DummyController extends AbstractController +{ + public function getContainer() + { + return $this->container; + } + + public function fooAction() + { + } +} From 400e76706d08540b2aa7fe5b3738a0621572fae0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 3 Jul 2017 17:21:42 +0300 Subject: [PATCH 03/33] updated CHANGELOG for 2.7.30 --- CHANGELOG-2.7.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG-2.7.md b/CHANGELOG-2.7.md index c93959532d..cf90bc2e50 100644 --- a/CHANGELOG-2.7.md +++ b/CHANGELOG-2.7.md @@ -7,6 +7,36 @@ in 2.7 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/v2.7.0...v2.7.1 +* 2.7.30 (2017-07-03) + + * bug #23341 [DoctrineBridge][Security][Validator] do not validate empty values (xabbuh) + * bug #23274 Display a better error design when the toolbar cannot be displayed (yceruto) + * bug #23333 [PropertyAccess] Fix TypeError discard (dunglas) + * bug #23345 [Console] fix description of INF default values (xabbuh) + * bug #23279 Don't call count on non countable object (pierredup) + * bug #23283 [TwigBundle] add back exception check (xabbuh) + * bug #23268 Show exception is checked twice in ExceptionController of twig (gmponos) + * bug #23266 Display a better error message when the toolbar cannot be displayed (javiereguiluz) + * bug #23271 [FrameworkBundle] allow SSI fragments configuration in XML files (xabbuh) + * bug #23254 [Form][TwigBridge] render hidden _method field in form_rest() (xabbuh) + * bug #23250 [Translation] return fallback locales whenever possible (xabbuh) + * bug #22732 [Security] fix switch user _exit without having current token (dmaicher) + * bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage (MacDada) + * bug #23195 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177 (NicolasPion) + * bug #23052 [TwigBundle] Add Content-Type header for exception response (rchoquet) + * bug #23199 Reset redirectCount when throwing exception (hvanoch) + * bug #23186 [TwigBundle] Move template.xml loading to a compiler pass (ogizanagi) + * bug #23130 Keep s-maxage when expiry and validation are used in combination (mpdude) + * bug #23129 Fix two edge cases in ResponseCacheStrategy (mpdude) + * feature #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #23057 [Translation][FrameworkBundle] Fix resource loading order inconsistency reported in #23034 (mpdude) + * bug #23092 [Filesystem] added workaround in Filesystem::rename for PHP bug (VolCh) + * bug #23128 [HttpFoundation] fix for Support for new 7.1 session options (vincentaubert) + * bug #23176 [VarDumper] fixes (nicolas-grekas) + * bug #23086 [FrameworkBundle] Fix perf issue in CacheClearCommand::warmup() (nicolas-grekas) + * bug #23098 Cache ipCheck (2.7) (gonzalovilaseca) + * 2.7.29 (2017-06-07) * bug #23069 [SecurityBundle] Show unique Inherited roles in profile panel (yceruto) From e688bdc811fe0506ba2a757633b318b05c9b32c8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 3 Jul 2017 17:22:39 +0300 Subject: [PATCH 04/33] update CONTRIBUTORS for 2.7.30 --- CONTRIBUTORS.md | 59 +++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 532b8a261c..0b695308c5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -20,11 +20,11 @@ Symfony is the result of the work of many people who made the code better - Javier Eguiluz (javier.eguiluz) - Hugo Hamon (hhamon) - Abdellatif Ait boudad (aitboudad) + - Maxime Steinhausser (ogizanagi) + - Robin Chalas (chalas_r) - Romain Neutron (romain) - Pascal Borreli (pborreli) - Wouter De Jong (wouterj) - - Robin Chalas (chalas_r) - - Maxime Steinhausser (ogizanagi) - Grégoire Pineau (lyrixx) - Joseph Bielawski (stloyd) - Karma Dordrak (drak) @@ -38,8 +38,8 @@ Symfony is the result of the work of many people who made the code better - Jules Pietri (heah) - Roland Franssen (ro0) - Sarah Khalil (saro0h) - - Jonathan Wage (jwage) - Guilhem Niot (energetick) + - Jonathan Wage (jwage) - Diego Saint Esteben (dosten) - Alexandre Salomé (alexandresalome) - William Durand (couac) @@ -48,24 +48,24 @@ Symfony is the result of the work of many people who made the code better - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - Bulat Shakirzyanov (avalanche123) - - Peter Rehm (rpet) - Iltar van der Berg (kjarli) + - Peter Rehm (rpet) - Saša Stamenković (umpirsky) - Henrik Bjørnskov (henrikbjorn) - Miha Vrhovnik - Diego Saint Esteben (dii3g0) - Konstantin Kudryashov (everzet) + - Matthias Pigulla (mpdude) - Bilal Amarni (bamarni) - Florin Patan (florinpatan) - - Matthias Pigulla (mpdude) + - Gábor Egyed (1ed) - Kevin Bond (kbond) - Andrej Hudec (pulzarraider) - - Gábor Egyed (1ed) + - Pierre du Plessis (pierredup) - Michel Weimerskirch (mweimerskirch) - Eric Clemmons (ericclemmons) - Charles Sarrazin (csarrazi) - Christian Raue - - Pierre du Plessis (pierredup) - Arnout Boks (aboks) - Deni - Henrik Westphal (snc) @@ -83,25 +83,27 @@ Symfony is the result of the work of many people who made the code better - Toni Uebernickel (havvg) - Bart van den Burg (burgov) - Jordan Alliot (jalliot) + - Jérôme Tamarelle (gromnan) - John Wards (johnwards) - Dariusz Ruminski - Fran Moreno (franmomu) - Antoine Hérault (herzult) - - Jérôme Tamarelle (gromnan) - Paráda József (paradajozsef) - Arnaud Le Blanc (arnaud-lb) - Maxime STEINHAUSSER + - Alexander M. Turek (derrabus) - Michal Piotrowski (eventhorizon) - Issei Murasawa (issei_m) - Tim Nagel (merk) - Brice BERNARD (brikou) - - Alexander M. Turek (derrabus) - Baptiste Clavié (talus) + - Vladimir Reznichenko (kalessil) - marc.weistroff - lenar - Włodzimierz Gajda (gajdaw) - - Vladimir Reznichenko (kalessil) + - Yonel Ceruto González (yonelceruto) - Alexander Schwenn (xelaris) + - Jacob Dreesen (jdreesen) - Florian Voutzinos (florianv) - Colin Frei - Adrien Brault (adrienbrault) @@ -109,10 +111,8 @@ Symfony is the result of the work of many people who made the code better - Peter Kokot (maastermedia) - David Buchmann (dbu) - excelwebzone - - Jacob Dreesen (jdreesen) - Tobias Nyholm (tobias) - Tomáš Votruba (tomas_votruba) - - Yonel Ceruto González (yonelceruto) - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - Eric GELOEN (gelo) @@ -124,13 +124,13 @@ Symfony is the result of the work of many people who made the code better - Sebastiaan Stok (sstok) - Stefano Sala (stefano.sala) - Evgeniy (ewgraf) + - Vincent AUBERT (vincent) - Juti Noppornpitak (shiroyuki) - Tigran Azatyan (tigranazatyan) - Sebastian Hörl (blogsh) - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) - Guilherme Blanco (guilhermeblanco) - - Vincent AUBERT (vincent) - Pablo Godel (pgodel) - Jérémie Augustin (jaugustin) - Andréia Bohner (andreia) @@ -147,6 +147,7 @@ Symfony is the result of the work of many people who made the code better - Thomas Rabaix (rande) - Rouven Weßling (realityking) - Teoh Han Hui (teohhanhui) + - David Maicher (dmaicher) - Jérôme Vasseur (jvasseur) - Clemens Tolboom - Helmer Aaviksoo @@ -154,16 +155,16 @@ Symfony is the result of the work of many people who made the code better - Hiromi Hishida (77web) - Matthieu Ouellette-Vachon (maoueh) - Michał Pipa (michal.pipa) + - Dawid Nowak - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba - - David Maicher (dmaicher) - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) - James Halsall (jaitsu) - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - - Dawid Nowak + - Lars Strojny (lstrojny) - Possum - Dorian Villet (gnutix) - Richard Miller (mr_r_miller) @@ -175,12 +176,12 @@ Symfony is the result of the work of many people who made the code better - Chris Wilkinson (thewilkybarkid) - Andreas Hucks (meandmymonkey) - Noel Guilbert (noel) - - Lars Strojny (lstrojny) - Stepan Anchugov (kix) - bronze1man - Daniel Espendiller - sun (sun) - Larry Garfield (crell) + - Oleg Voronkovich - Martin Schuhfuß (usefulthink) - apetitpa - Matthieu Bontemps (mbontemps) @@ -242,7 +243,6 @@ Symfony is the result of the work of many people who made the code better - Uwe Jäger (uwej711) - Eugene Leonovich (rybakit) - Filippo Tessarotto - - Oleg Voronkovich - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) - GordonsLondon @@ -294,6 +294,7 @@ Symfony is the result of the work of many people who made the code better - Victor Bocharsky (bocharsky_bw) - Jan Decavele (jandc) - Gustavo Piltcher + - Nikolay Labinskiy (e-moe) - Stepan Tanasiychuk (stfalcon) - Tiago Ribeiro (fixe) - Hidde Boomsma (hboomsma) @@ -359,7 +360,6 @@ Symfony is the result of the work of many people who made the code better - Endre Fejes - Tobias Naumann (tna) - Daniel Beyer - - Nikolay Labinskiy (e-moe) - Shein Alexey - Romain Gautier (mykiwi) - Joe Lencioni @@ -609,6 +609,7 @@ Symfony is the result of the work of many people who made the code better - Kevin (oxfouzer) - Paweł Wacławczyk (pwc) - Oleg Zinchenko (cystbear) + - Baptiste Meyer (meyerbaptiste) - Johannes Klauss (cloppy) - Evan Villemez - fzerorubigd @@ -671,6 +672,7 @@ Symfony is the result of the work of many people who made the code better - Benoit Lévêque (benoit_leveque) - Jeroen Fiege (fieg) - Krzysiek Łabuś + - George Mponos (gmponos) - Xavier Lacot (xavier) - possum - Denis Zunke (donalberto) @@ -734,6 +736,7 @@ Symfony is the result of the work of many people who made the code better - Omar Yepez (oyepez003) - mwsaz - Jelle Kapitein + - Ben Scott - Benoît Bourgeois - mantulo - corphi @@ -815,6 +818,7 @@ Symfony is the result of the work of many people who made the code better - ttomor - Mei Gwilym (meigwilym) - Michael H. Arieli (excelwebzone) + - Tom Panier (neemzy) - Fred Cox - Luciano Mammino (loige) - fabios @@ -850,6 +854,7 @@ Symfony is the result of the work of many people who made the code better - Máximo Cuadros (mcuadros) - tamirvs - julien.galenski + - Israel J. Carberry - Bob van de Vijver - Christian Neff - Per Sandström (per) @@ -888,7 +893,6 @@ Symfony is the result of the work of many people who made the code better - Eddie Jaoude - Antanas Arvasevicius - Haritz Iturbe (hizai) - - Baptiste Meyer (meyerbaptiste) - Nerijus Arlauskas (nercury) - SPolischook - Diego Sapriza @@ -910,8 +914,10 @@ Symfony is the result of the work of many people who made the code better - Marcin Chwedziak - hjkl - Tony Cosentino (tony-co) + - Dan Wilga - Alexander Cheprasov - Rodrigo Díez Villamuera (rodrigodiez) + - Malte Blättermann - e-ivanov - Jochen Bayer (jocl) - Jeremy Bush @@ -923,12 +929,14 @@ Symfony is the result of the work of many people who made the code better - Péter Buri (burci) - Davide Borsatto (davide.borsatto) - kaiwa + - RJ Garcia - Charles Sanquer (csanquer) - Albert Ganiev (helios-ag) - Neil Katin - David Otton - Will Donohoe - peter + - Jaroslav Kuba - flip111 - Jérémy Jourdin (jjk801) - BRAMILLE Sébastien (oktapodia) @@ -936,6 +944,7 @@ Symfony is the result of the work of many people who made the code better - Gustavo Adrian - Yannick - spdionis + - rchoquet - Taras Girnyk - Eduardo García Sanz (coma) - James Gilliland @@ -965,6 +974,7 @@ Symfony is the result of the work of many people who made the code better - Paul Matthews - Juan Traverso - Tarjei Huse (tarjei) + - tsufeki - Philipp Strube - Christian Sciberras - Clement Herreman (clemherreman) @@ -1055,6 +1065,7 @@ Symfony is the result of the work of many people who made the code better - m.chwedziak - Philip Frank - Lance McNearney + - Gonzalo Vilaseca (gonzalovilaseca) - Giorgio Premi - Ian Carroll - caponica @@ -1065,7 +1076,6 @@ Symfony is the result of the work of many people who made the code better - adev - Luis Galeas - Martin Pärtel - - George Mponos (gmponos) - Patrick Daley (padrig) - Xavier Briand (xavierbriand) - Max Summe @@ -1146,6 +1156,7 @@ Symfony is the result of the work of many people who made the code better - Hoffmann András - Olivier - pscheit + - Wybren Koelmans - Zdeněk Drahoš - Dan Harper - moldcraft @@ -1233,6 +1244,7 @@ Symfony is the result of the work of many people who made the code better - Fabien LUCAS (flucas2) - Indra Gunawan (indragunawan) - Karim Cassam Chenaï (ka) + - Michal Kurzeja (mkurzeja) - Nicolas Bastien (nicolas_bastien) - Denis (yethee) - Andrew Zhilin (zhil) @@ -1251,9 +1263,11 @@ Symfony is the result of the work of many people who made the code better - Warwick - VJ - Chris + - Florent Olivaud - JakeFr - Simon Sargeant - efeen + - Nicolas Pion - Muhammed Akbulut - Michał Dąbrowski (defrag) - Simone Fumagalli (hpatoio) @@ -1270,6 +1284,7 @@ Symfony is the result of the work of many people who made the code better - Grinbergs Reinis (shima5) - Artem Lopata (bumz) - Nicole Cordes + - VolCh - Alexey Popkov - Gijs Kunze - Artyom Protaskin @@ -1375,6 +1390,7 @@ Symfony is the result of the work of many people who made the code better - Dane Powell - Gerrit Drost - Linnaea Von Lavia + - Javan Eskander - Lenar Lõhmus - Cristian Gonzalez - AlberT @@ -1423,7 +1439,6 @@ Symfony is the result of the work of many people who made the code better - Yanick Witschi - Ondrej Mirtes - akimsko - - Ben Scott - Youpie - srsbiz - Taylan Kasap @@ -1556,6 +1571,7 @@ Symfony is the result of the work of many people who made the code better - Dawid Nowak - Lesnykh Ilia - Karolis Daužickas + - Nicolas - Sergio Santoro - tirnanog06 - phc @@ -1689,6 +1705,7 @@ Symfony is the result of the work of many people who made the code better - Adam Elsodaney (archfizz) - Daniel Kolvik (dkvk) - Marc Lemay (flug) + - Henne Van Och (hennevo) - Jeroen De Dauw (jeroendedauw) - Maxime COLIN (maximecolin) - Muharrem Demirci (mdemirci) From 75443d232b0ebe6486c2ace29d8e63100d1f8857 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 3 Jul 2017 17:22:50 +0300 Subject: [PATCH 05/33] updated VERSION for 2.7.30 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 6b540518fc..93be7003c1 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.7.30-DEV'; + const VERSION = '2.7.30'; const VERSION_ID = 20730; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; const RELEASE_VERSION = 30; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From fa6b45bc58936af8e07f5818d7a451ea104a8307 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 3 Jul 2017 18:37:36 +0300 Subject: [PATCH 06/33] bumped Symfony version to 2.7.31 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 93be7003c1..fc6c87b9e0 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.7.30'; - const VERSION_ID = 20730; + const VERSION = '2.7.31-DEV'; + const VERSION_ID = 20731; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; - const RELEASE_VERSION = 30; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 31; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From 08a6178e77e1fd5bc44a39215861dc4ffd48388b Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Tue, 4 Jul 2017 00:07:18 +0200 Subject: [PATCH 07/33] Don't access private services from container aware commands (deprecated) --- .../Command/RouterDebugCommand.php | 3 +- .../Tests/Command/RouterDebugCommandTest.php | 31 +++++++++----- .../Tests/Command/RouterMatchCommandTest.php | 42 +++++++++++-------- 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php index 97707e8798..a08c1a3521 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Command; use Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper; +use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -109,7 +110,7 @@ EOF private function convertController(Route $route) { - $nameParser = $this->getContainer()->get('controller_name_converter'); + $nameParser = new ControllerNameParser($this->getApplication()->getKernel()); if ($route->hasDefault('_controller')) { try { $route->setDefault('_controller', $nameParser->build($route->getDefault('_controller'))); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php index 6d32a37fd0..597082485a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php @@ -12,9 +12,10 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Application; +use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand; +use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; @@ -51,16 +52,15 @@ class RouterDebugCommandTest extends TestCase */ private function createCommandTester() { - $application = new Application(); + $application = new Application($this->getKernel()); $command = new RouterDebugCommand(); - $command->setContainer($this->getContainer()); $application->add($command); return new CommandTester($application->find('debug:router')); } - private function getContainer() + private function getKernel() { $routeCollection = new RouteCollection(); $routeCollection->add('foo', new Route('foo')); @@ -82,14 +82,25 @@ class RouterDebugCommandTest extends TestCase ->with('router') ->will($this->returnValue(true)) ; - $container + ->expects($this->any()) ->method('get') - ->will($this->returnValueMap(array( - array('router', 1, $router), - array('controller_name_converter', 1, $loader), - ))); + ->with('router') + ->willReturn($router) + ; - return $container; + $kernel = $this->getMockBuilder(KernelInterface::class)->getMock(); + $kernel + ->expects($this->any()) + ->method('getContainer') + ->willReturn($container) + ; + $kernel + ->expects($this->once()) + ->method('getBundles') + ->willReturn(array()) + ; + + return $kernel; } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php index cd15b8c5e8..384bd7ca53 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php @@ -12,10 +12,11 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Application; +use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand; use Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand; +use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\RequestContext; @@ -45,20 +46,14 @@ class RouterMatchCommandTest extends TestCase */ private function createCommandTester() { - $application = new Application(); - - $command = new RouterMatchCommand(); - $command->setContainer($this->getContainer()); - $application->add($command); - - $command = new RouterDebugCommand(); - $command->setContainer($this->getContainer()); - $application->add($command); + $application = new Application($this->getKernel()); + $application->add(new RouterMatchCommand()); + $application->add(new RouterDebugCommand()); return new CommandTester($application->find('router:match')); } - private function getContainer() + private function getKernel() { $routeCollection = new RouteCollection(); $routeCollection->add('foo', new Route('foo')); @@ -81,16 +76,27 @@ class RouterMatchCommandTest extends TestCase $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock(); $container - ->expects($this->once()) + ->expects($this->atLeastOnce()) ->method('has') ->with('router') ->will($this->returnValue(true)); - $container->method('get') - ->will($this->returnValueMap(array( - array('router', 1, $router), - array('controller_name_converter', 1, $loader), - ))); + $container + ->expects($this->any()) + ->method('get') + ->willReturn($router); - return $container; + $kernel = $this->getMockBuilder(KernelInterface::class)->getMock(); + $kernel + ->expects($this->any()) + ->method('getContainer') + ->willReturn($container) + ; + $kernel + ->expects($this->once()) + ->method('getBundles') + ->willReturn(array()) + ; + + return $kernel; } } From 22998645956f063fc20b13beee668d44ce96038e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 08:30:58 +0300 Subject: [PATCH 08/33] updated CHANGELOG for 2.8.23 --- CHANGELOG-2.8.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CHANGELOG-2.8.md b/CHANGELOG-2.8.md index da6f2aeebb..ce55fb1631 100644 --- a/CHANGELOG-2.8.md +++ b/CHANGELOG-2.8.md @@ -7,6 +7,40 @@ in 2.8 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/v2.8.0...v2.8.1 +* 2.8.23 (2017-07-04) + + * bug #23341 [DoctrineBridge][Security][Validator] do not validate empty values (xabbuh) + * bug #23274 Display a better error design when the toolbar cannot be displayed (yceruto) + * bug #23333 [PropertyAccess] Fix TypeError discard (dunglas) + * bug #23345 [Console] fix description of INF default values (xabbuh) + * bug #23279 Don't call count on non countable object (pierredup) + * bug #23283 [TwigBundle] add back exception check (xabbuh) + * bug #23268 Show exception is checked twice in ExceptionController of twig (gmponos) + * bug #23266 Display a better error message when the toolbar cannot be displayed (javiereguiluz) + * bug #23271 [FrameworkBundle] allow SSI fragments configuration in XML files (xabbuh) + * bug #23254 [Form][TwigBridge] render hidden _method field in form_rest() (xabbuh) + * bug #23250 [Translation] return fallback locales whenever possible (xabbuh) + * bug #23240 [Console] Fix catching exception type in QuestionHelper (voronkovich) + * bug #23229 [WebProfilerBundle] Eliminate line wrap on count column (routing) (e-moe) + * bug #22732 [Security] fix switch user _exit without having current token (dmaicher) + * bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage (MacDada) + * bug #23195 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177 (NicolasPion) + * bug #23052 [TwigBundle] Add Content-Type header for exception response (rchoquet) + * bug #23199 Reset redirectCount when throwing exception (hvanoch) + * bug #23186 [TwigBundle] Move template.xml loading to a compiler pass (ogizanagi) + * bug #23130 Keep s-maxage when expiry and validation are used in combination (mpdude) + * bug #23129 Fix two edge cases in ResponseCacheStrategy (mpdude) + * feature #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #23057 [Translation][FrameworkBundle] Fix resource loading order inconsistency reported in #23034 (mpdude) + * bug #23092 [Filesystem] added workaround in Filesystem::rename for PHP bug (VolCh) + * bug #23128 [HttpFoundation] fix for Support for new 7.1 session options (vincentaubert) + * bug #23176 [VarDumper] fixes (nicolas-grekas) + * bug #22953 #22839 - changed debug toolbar dump section to relative and use full window width (mkurzeja) + * bug #23086 [FrameworkBundle] Fix perf issue in CacheClearCommand::warmup() (nicolas-grekas) + * bug #23098 Cache ipCheck (2.7) (gonzalovilaseca) + * bug #23069 [SecurityBundle] Show unique Inherited roles in profile panel (yceruto) + * 2.8.22 (2017-06-07) * bug #23073 [TwigBridge] Fix namespaced classes (ogizanagi) From f9b42239904b4326a2a0a380ffa74f41084a6869 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 08:31:02 +0300 Subject: [PATCH 09/33] updated VERSION for 2.8.23 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 37e10de8c6..48cb62a602 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.23-DEV'; + const VERSION = '2.8.23'; const VERSION_ID = 20823; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; const RELEASE_VERSION = 23; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From d011d57f812a9be8e9bc04b8330bb90e5aec896c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 08:43:52 +0300 Subject: [PATCH 10/33] bumped Symfony version to 2.8.24 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 48cb62a602..67a02337b5 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.23'; - const VERSION_ID = 20823; + const VERSION = '2.8.24-DEV'; + const VERSION_ID = 20824; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; - const RELEASE_VERSION = 23; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 24; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From e87e64e5e1fe0f6f3aab40ec491fc50630281f71 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 08:44:55 +0300 Subject: [PATCH 11/33] updated CHANGELOG for 3.2.10 --- CHANGELOG-3.2.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/CHANGELOG-3.2.md b/CHANGELOG-3.2.md index de1e0fd980..5542e4160d 100644 --- a/CHANGELOG-3.2.md +++ b/CHANGELOG-3.2.md @@ -7,6 +7,58 @@ in 3.2 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.2.0...v3.2.1 +* 3.2.10 (2017-07-04) + + * bug #23366 [FrameworkBundle] Don't get() private services from debug:router (chalasr) + * bug #23341 [DoctrineBridge][Security][Validator] do not validate empty values (xabbuh) + * bug #23274 Display a better error design when the toolbar cannot be displayed (yceruto) + * bug #23296 [WebProfilerBundle] Fix css trick used for offsetting html anchor from fixed header (ogizanagi) + * bug #23333 [PropertyAccess] Fix TypeError discard (dunglas) + * bug #23326 [Cache] fix cleanup of expired items for PdoAdapter (dmaicher) + * bug #23345 [Console] fix description of INF default values (xabbuh) + * bug #23299 [Workflow] Added more events to the announce function (Nyholm) + * bug #23279 Don't call count on non countable object (pierredup) + * bug #23283 [TwigBundle] add back exception check (xabbuh) + * bug #23268 Show exception is checked twice in ExceptionController of twig (gmponos) + * bug #23266 Display a better error message when the toolbar cannot be displayed (javiereguiluz) + * bug #23271 [FrameworkBundle] allow SSI fragments configuration in XML files (xabbuh) + * bug #23254 [Form][TwigBridge] render hidden _method field in form_rest() (xabbuh) + * bug #23250 [Translation] return fallback locales whenever possible (xabbuh) + * bug #23240 [Console] Fix catching exception type in QuestionHelper (voronkovich) + * bug #23229 [WebProfilerBundle] Eliminate line wrap on count column (routing) (e-moe) + * bug #22732 [Security] fix switch user _exit without having current token (dmaicher) + * bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage (MacDada) + * bug #23195 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177 (NicolasPion) + * bug #23052 [TwigBundle] Add Content-Type header for exception response (rchoquet) + * bug #23199 Reset redirectCount when throwing exception (hvanoch) + * bug #23186 [TwigBundle] Move template.xml loading to a compiler pass (ogizanagi) + * bug #23130 Keep s-maxage when expiry and validation are used in combination (mpdude) + * bug #23129 Fix two edge cases in ResponseCacheStrategy (mpdude) + * feature #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22943 [SecurityBundle] Move cache of the firewall context into the request parameters (GromNaN) + * bug #23057 [Translation][FrameworkBundle] Fix resource loading order inconsistency reported in #23034 (mpdude) + * bug #23092 [Filesystem] added workaround in Filesystem::rename for PHP bug (VolCh) + * bug #23128 [HttpFoundation] fix for Support for new 7.1 session options (vincentaubert) + * bug #23176 [VarDumper] fixes (nicolas-grekas) + * bug #23100 [PropertyAccess] Do not silence TypeErrors from client code. (tsufeki) + * bug #23156 [PropertyAccess] Fix Usage with anonymous classes (mablae) + * bug #23091 [Cache] ApcuAdapter::isSupported() should return true when apc.enable_cli=Off (nicolas-grekas) + * bug #22953 #22839 - changed debug toolbar dump section to relative and use full window width (mkurzeja) + * bug #23086 [FrameworkBundle] Fix perf issue in CacheClearCommand::warmup() (nicolas-grekas) + * bug #23098 Cache ipCheck (2.7) (gonzalovilaseca) + * bug #23069 [SecurityBundle] Show unique Inherited roles in profile panel (yceruto) + * bug #23073 [TwigBridge] Fix namespaced classes (ogizanagi) + * bug #23063 [Cache] Fix extensibility of TagAwareAdapter::TAGS_PREFIX (wucdbm) + * bug #22936 [Form] Mix attr option between guessed options and user options (yceruto) + * bug #22976 [DependencyInjection] Use more clear message when unused environment variables detected (voronkovich) + * bug #23045 [Cache] fix Redis scheme detection (xabbuh) + * bug #22988 [PropertyInfo][DoctrineBridge] The bigint Doctrine's type must be converted to string (dunglas) + * bug #23014 Fix optional cache warmers are always instantiated whereas they should be lazy-loaded (romainneutron) + * bug #23024 [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null) (nicolas-grekas) + * bug #22996 [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 (romainneutron) + * bug #22994 Harden the debugging of Twig filters and functions (stof) + * 3.2.9 (2017-05-29) * bug #22847 [Console] ChoiceQuestion must have choices (ro0NL) From af3fcc11ed9e594795bb93a32adf9a964aa34e82 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 08:45:03 +0300 Subject: [PATCH 12/33] updated VERSION for 3.2.10 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 30270f0714..e36c621722 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '3.2.10-DEV'; + const VERSION = '3.2.10'; const VERSION_ID = 30210; const MAJOR_VERSION = 3; const MINOR_VERSION = 2; const RELEASE_VERSION = 10; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '07/2017'; const END_OF_LIFE = '01/2018'; From ddc9d2e31327633c2488575a8c5bfc707b01fa50 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 09:01:46 +0300 Subject: [PATCH 13/33] bumped Symfony version to 3.2.11 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index e36c621722..599cf6da6f 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '3.2.10'; - const VERSION_ID = 30210; + const VERSION = '3.2.11-DEV'; + const VERSION_ID = 30211; const MAJOR_VERSION = 3; const MINOR_VERSION = 2; - const RELEASE_VERSION = 10; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 11; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '07/2017'; const END_OF_LIFE = '01/2018'; From fcb6171d9ef8161cb1dbd02eb0f98182848a2c5c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 09:02:47 +0300 Subject: [PATCH 14/33] updated CHANGELOG for 3.3.3 --- CHANGELOG-3.3.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/CHANGELOG-3.3.md b/CHANGELOG-3.3.md index 6c3cb3540f..1817eff602 100644 --- a/CHANGELOG-3.3.md +++ b/CHANGELOG-3.3.md @@ -7,6 +7,72 @@ in 3.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/v3.3.0...v3.3.1 +* 3.3.3 (2017-07-04) + + * bug #23366 [FrameworkBundle] Don't get() private services from debug:router (chalasr) + * bug #23239 [FrameworkBundle] call setContainer() for autowired controllers (xabbuh) + * bug #23351 [Dotenv] parse concatenated variable values (xabbuh) + * bug #23341 [DoctrineBridge][Security][Validator] do not validate empty values (xabbuh) + * bug #23274 Display a better error design when the toolbar cannot be displayed (yceruto) + * bug #23342 [Dotenv] parse escaped quotes in unquoted env var values (xabbuh) + * bug #23291 [Security] Fix Firewall ExceptionListener priority (chalasr) + * bug #23296 [WebProfilerBundle] Fix css trick used for offsetting html anchor from fixed header (ogizanagi) + * bug #23333 [PropertyAccess] Fix TypeError discard (dunglas) + * bug #23326 [Cache] fix cleanup of expired items for PdoAdapter (dmaicher) + * bug #23345 [Console] fix description of INF default values (xabbuh) + * bug #23328 [FrameworkBundle] Display a proper warning on cache:clear without the --no-warmup option (ogizanagi) + * bug #23299 [Workflow] Added more events to the announce function (Nyholm) + * bug #23279 Don't call count on non countable object (pierredup) + * bug #23283 [TwigBundle] add back exception check (xabbuh) + * bug #23268 Show exception is checked twice in ExceptionController of twig (gmponos) + * bug #23266 Display a better error message when the toolbar cannot be displayed (javiereguiluz) + * bug #23271 [FrameworkBundle] allow SSI fragments configuration in XML files (xabbuh) + * bug #23254 [Form][TwigBridge] render hidden _method field in form_rest() (xabbuh) + * bug #23250 [Translation] return fallback locales whenever possible (xabbuh) + * bug #23237 [Cache] Fix Predis client cluster with pipeline (flolivaud) + * bug #23240 [Console] Fix catching exception type in QuestionHelper (voronkovich) + * bug #23218 [DI] Dedup tags when using instanceof/autoconfigure (ogizanagi) + * bug #23231 Improved the exception page when there is no message (javiereguiluz) + * bug #23229 [WebProfilerBundle] Eliminate line wrap on count column (routing) (e-moe) + * bug #22732 [Security] fix switch user _exit without having current token (dmaicher) + * bug #23226 [Validator] replace hardcoded service id (xabbuh) + * bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage (MacDada) + * bug #23195 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177 (NicolasPion) + * bug #23213 Fixed composer resources between web/cli (iltar) + * bug #23160 [WebProfilerBundle] Fix the icon for the Cache panel (javiereguiluz) + * bug #23052 [TwigBundle] Add Content-Type header for exception response (rchoquet) + * bug #23173 [WebServerBundle] Fix router script option BC (1ed) + * bug #23199 Reset redirectCount when throwing exception (hvanoch) + * bug #23180 [FrameworkBundle] Expose the AbstractController's container to its subclasses (BPScott) + * bug #23186 [TwigBundle] Move template.xml loading to a compiler pass (ogizanagi) + * bug #23130 Keep s-maxage when expiry and validation are used in combination (mpdude) + * bug #23129 Fix two edge cases in ResponseCacheStrategy (mpdude) + * feature #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22943 [SecurityBundle] Move cache of the firewall context into the request parameters (GromNaN) + * bug #23088 [FrameworkBundle] Dont set pre-defined esi/ssi services (ro0NL) + * bug #23057 [Translation][FrameworkBundle] Fix resource loading order inconsistency reported in #23034 (mpdude) + * bug #23092 [Filesystem] added workaround in Filesystem::rename for PHP bug (VolCh) + * bug #23074 [HttpFoundation] add back support for legacy constant values (xabbuh) + * bug #23128 [HttpFoundation] fix for Support for new 7.1 session options (vincentaubert) + * bug #23176 [VarDumper] fixes (nicolas-grekas) + * bug #23100 [PropertyAccess] Do not silence TypeErrors from client code. (tsufeki) + * bug #23156 [PropertyAccess] Fix Usage with anonymous classes (mablae) + * bug #23168 [Config] Fix ** GlobResource on Windows (nicolas-grekas) + * bug #23171 [Yaml] Fix linting yaml with constants as keys (chalasr) + * bug #23121 [Routing] Revert the change in [#b42018] with respect to Routing/Route.php (Dan Wilga) + * bug #23141 [DI] Fix keys resolution in ResolveParameterPlaceHoldersPass (nicolas-grekas) + * bug #23145 Fix the conditional definition of the SymfonyTestsListener (stof) + * bug #23091 [Cache] ApcuAdapter::isSupported() should return true when apc.enable_cli=Off (nicolas-grekas) + * bug #22953 #22839 - changed debug toolbar dump section to relative and use full window width (mkurzeja) + * bug #23086 [FrameworkBundle] Fix perf issue in CacheClearCommand::warmup() (nicolas-grekas) + * bug #23090 [SecurityBundle] Made 2 service aliases private (nicolas-grekas) + * bug #23108 [Yaml] Remove line number in deprecation notices (nicolas-grekas) + * bug #23098 Cache ipCheck (2.7) (gonzalovilaseca) + * bug #23082 [MonologBridge] Do not silence errors in ServerLogHandler::formatRecord (lyrixx) + * bug #23007 [HttpKernel][Debug] Fix missing trace on deprecations collected during bootstrapping & silenced errors (ogizanagi) + * bug #23069 [SecurityBundle] Show unique Inherited roles in profile panel (yceruto) + * 3.3.2 (2017-06-06) * bug #23073 [TwigBridge] Fix namespaced classes (ogizanagi) From 5d8d746a100d9eff0500a058fde8b06189155f11 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 09:02:59 +0300 Subject: [PATCH 15/33] updated VERSION for 3.3.3 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index a89e4d50bb..955be15e9e 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -61,12 +61,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface private $projectDir; - const VERSION = '3.3.3-DEV'; + const VERSION = '3.3.3'; const VERSION_ID = 30303; const MAJOR_VERSION = 3; const MINOR_VERSION = 3; const RELEASE_VERSION = 3; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2018'; const END_OF_LIFE = '07/2018'; From 5de56eba9a59bfc53075c3a6443a8e747676425d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 4 Jul 2017 09:15:40 +0300 Subject: [PATCH 16/33] bumped Symfony version to 3.3.4 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 955be15e9e..1a0f2434dc 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -61,12 +61,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface private $projectDir; - const VERSION = '3.3.3'; - const VERSION_ID = 30303; + const VERSION = '3.3.4-DEV'; + const VERSION_ID = 30304; const MAJOR_VERSION = 3; const MINOR_VERSION = 3; - const RELEASE_VERSION = 3; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 4; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2018'; const END_OF_LIFE = '07/2018'; From c75e486413ad0a2aa54dff937a19e9d3fd7bc170 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Tue, 4 Jul 2017 09:43:54 +0200 Subject: [PATCH 17/33] [FrameworkBundle] 3.3: Don't get() private services from debug:router --- .../Bundle/FrameworkBundle/Command/RouterDebugCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php index e7d6d80a57..f26fddabb0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php @@ -137,7 +137,7 @@ EOF } } - $nameParser = $this->getContainer()->get('controller_name_converter'); + $nameParser = new ControllerNameParser($this->getApplication()->getKernel()); try { $shortNotation = $nameParser->build($controller); $route->setDefault('_controller', $shortNotation); From 6ed9c8d8c5af201caaa0be47b4a48ae950721891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Egyed?= Date: Tue, 4 Jul 2017 11:39:25 +0200 Subject: [PATCH 18/33] [FrameworkBundle] Do not remove files from assets dir --- .../Command/AssetsInstallCommand.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index 0a3ea2871d..27cccd869e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -92,7 +92,9 @@ EOT $validAssetDirs = array(); foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) { if (is_dir($originDir = $bundle->getPath().'/Resources/public')) { - $targetDir = $bundlesDir.preg_replace('/bundle$/', '', strtolower($bundle->getName())); + $assetDir = preg_replace('/bundle$/', '', strtolower($bundle->getName())); + $targetDir = $bundlesDir.$assetDir; + $validAssetDirs[] = $assetDir; $output->writeln(sprintf('Installing assets for %s into %s', $bundle->getNamespace(), $targetDir)); @@ -132,15 +134,12 @@ EOT } else { $this->hardCopy($originDir, $targetDir); } - $validAssetDirs[] = $targetDir; } } + // remove the assets of the bundles that no longer exist - foreach (new \FilesystemIterator($bundlesDir) as $dir) { - if (!in_array($dir, $validAssetDirs)) { - $filesystem->remove($dir); - } - } + $dirsToRemove = Finder::create()->depth(0)->directories()->exclude($validAssetDirs)->in($bundlesDir); + $filesystem->remove($dirsToRemove); } /** From 9737bcc02442f067411f18ae46dd48a9e25b9105 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Tue, 4 Jul 2017 14:04:47 +0200 Subject: [PATCH 19/33] [DoctrineBridge] Use normalizedIds for resetting entity manager services --- src/Symfony/Bridge/Doctrine/ManagerRegistry.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php index d602bfc2ac..b30fd0691b 100644 --- a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php +++ b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php @@ -53,7 +53,10 @@ abstract class ManagerRegistry extends AbstractManagerRegistry implements Contai } $manager->setProxyInitializer(\Closure::bind( function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) { - if (isset($this->aliases[$name = strtolower($name)])) { + if (isset($this->normalizedIds[$normalizedId = strtolower($name)])) { + $name = $this->normalizedIds[$normalizedId]; + } + if (isset($this->aliases[$name])) { $name = $this->aliases[$name]; } $method = !isset($this->methodMap[$name]) ? 'get'.strtr($name, $this->underscoreMap).'Service' : $this->methodMap[$name]; From 47020c4904d4d01d39b5166097efc1ea24d8945a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 4 Jul 2017 17:41:55 +0300 Subject: [PATCH 20/33] [Cache] Handle APCu failures gracefully --- src/Symfony/Component/Cache/Adapter/AbstractAdapter.php | 5 ++++- src/Symfony/Component/Cache/Adapter/ApcuAdapter.php | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php index b5f6a61b56..84bb841d85 100644 --- a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php @@ -15,6 +15,7 @@ use Psr\Cache\CacheItemInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; use Psr\Log\LoggerInterface; +use Psr\Log\NullLogger; use Symfony\Component\Cache\CacheItem; use Symfony\Component\Cache\Exception\InvalidArgumentException; @@ -108,7 +109,9 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface } $apcu = new ApcuAdapter($namespace, (int) $defaultLifetime / 5, $version); - if (null !== $logger) { + if ('cli' === PHP_SAPI && !ini_get('apc.enable_cli')) { + $apcu->setLogger(new NullLogger()); + } elseif (null !== $logger) { $apcu->setLogger($logger); } diff --git a/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php b/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php index 6687bd4272..ad3aadf1a5 100644 --- a/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/ApcuAdapter.php @@ -50,7 +50,7 @@ class ApcuAdapter extends AbstractAdapter protected function doFetch(array $ids) { try { - return apcu_fetch($ids); + return apcu_fetch($ids) ?: array(); } catch (\Error $e) { throw new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine()); } @@ -92,7 +92,11 @@ class ApcuAdapter extends AbstractAdapter protected function doSave(array $values, $lifetime) { try { - return array_keys(apcu_store($values, null, $lifetime)); + if (false === $failures = apcu_store($values, null, $lifetime)) { + $failures = $values; + } + + return array_keys($failures); } catch (\Error $e) { } catch (\Exception $e) { } From 58ba4818a67aabf4f1bc424982ed7914fd819b5e Mon Sep 17 00:00:00 2001 From: Dariusz Date: Tue, 4 Jul 2017 23:00:55 +0200 Subject: [PATCH 21/33] Fix indent of methods --- .../SecurityRoutingIntegrationTest.php | 36 ++++---- .../LegacyApcUniversalClassLoaderTest.php | 88 +++++++++---------- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php index 3abfd9585f..5996415e10 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php @@ -78,27 +78,27 @@ class SecurityRoutingIntegrationTest extends WebTestCase $this->assertRestricted($barredClient, '/secured-by-two-ips'); } - /** - * @dataProvider getConfigs - */ - public function testSecurityConfigurationForExpression($config) - { - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0')); - $this->assertAllowed($allowedClient, '/protected-via-expression'); + /** + * @dataProvider getConfigs + */ + public function testSecurityConfigurationForExpression($config) + { + $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0')); + $this->assertAllowed($allowedClient, '/protected-via-expression'); - $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); - $this->assertRestricted($barredClient, '/protected-via-expression'); + $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); + $this->assertRestricted($barredClient, '/protected-via-expression'); - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); + $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); - $allowedClient->request('GET', '/protected-via-expression'); - $form = $allowedClient->followRedirect()->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'test'; - $allowedClient->submit($form); - $this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression'); - $this->assertAllowed($allowedClient, '/protected-via-expression'); - } + $allowedClient->request('GET', '/protected-via-expression'); + $form = $allowedClient->followRedirect()->selectButton('login')->form(); + $form['_username'] = 'johannes'; + $form['_password'] = 'test'; + $allowedClient->submit($form); + $this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression'); + $this->assertAllowed($allowedClient, '/protected-via-expression'); + } private function assertAllowed($client, $path) { diff --git a/src/Symfony/Component/ClassLoader/Tests/LegacyApcUniversalClassLoaderTest.php b/src/Symfony/Component/ClassLoader/Tests/LegacyApcUniversalClassLoaderTest.php index 6d4e57e984..8ef97bfd58 100644 --- a/src/Symfony/Component/ClassLoader/Tests/LegacyApcUniversalClassLoaderTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/LegacyApcUniversalClassLoaderTest.php @@ -43,17 +43,17 @@ class LegacyApcUniversalClassLoaderTest extends TestCase $this->assertEquals($loader->findFile('\LegacyApc\Namespaced\FooBar'), apcu_fetch('test.prefix.\LegacyApc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument'); } - /** - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className, $testClassName, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.'); - $loader->registerNamespace('LegacyApc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } + /** + * @dataProvider getLoadClassTests + */ + public function testLoadClass($className, $testClassName, $message) + { + $loader = new ApcUniversalClassLoader('test.prefix.'); + $loader->registerNamespace('LegacyApc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); + $loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); + $loader->loadClass($testClassName); + $this->assertTrue(class_exists($className), $message); + } public function getLoadClassTests() { @@ -63,19 +63,19 @@ class LegacyApcUniversalClassLoaderTest extends TestCase ); } - /** - * @dataProvider getLoadClassFromFallbackTests - */ - public function testLoadClassFromFallback($className, $testClassName, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.fallback'); - $loader->registerNamespace('LegacyApc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback')); - $loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback')); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } + /** + * @dataProvider getLoadClassFromFallbackTests + */ + public function testLoadClassFromFallback($className, $testClassName, $message) + { + $loader = new ApcUniversalClassLoader('test.prefix.fallback'); + $loader->registerNamespace('LegacyApc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); + $loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); + $loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback')); + $loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback')); + $loader->loadClass($testClassName); + $this->assertTrue(class_exists($className), $message); + } public function getLoadClassFromFallbackTests() { @@ -87,18 +87,18 @@ class LegacyApcUniversalClassLoaderTest extends TestCase ); } - /** - * @dataProvider getLoadClassNamespaceCollisionTests - */ - public function testLoadClassNamespaceCollision($namespaces, $className, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.collision.'); - $loader->registerNamespaces($namespaces); + /** + * @dataProvider getLoadClassNamespaceCollisionTests + */ + public function testLoadClassNamespaceCollision($namespaces, $className, $message) + { + $loader = new ApcUniversalClassLoader('test.prefix.collision.'); + $loader->registerNamespaces($namespaces); - $loader->loadClass($className); + $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } + $this->assertTrue(class_exists($className), $message); + } public function getLoadClassNamespaceCollisionTests() { @@ -138,17 +138,17 @@ class LegacyApcUniversalClassLoaderTest extends TestCase ); } - /** - * @dataProvider getLoadClassPrefixCollisionTests - */ - public function testLoadClassPrefixCollision($prefixes, $className, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.collision.'); - $loader->registerPrefixes($prefixes); + /** + * @dataProvider getLoadClassPrefixCollisionTests + */ + public function testLoadClassPrefixCollision($prefixes, $className, $message) + { + $loader = new ApcUniversalClassLoader('test.prefix.collision.'); + $loader->registerPrefixes($prefixes); - $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } + $loader->loadClass($className); + $this->assertTrue(class_exists($className), $message); + } public function getLoadClassPrefixCollisionTests() { From d879eed12aa9973ca0dbecf5769412723aeffb17 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 5 Jul 2017 09:33:38 +0300 Subject: [PATCH 22/33] fixed bad merge --- src/Symfony/Component/HttpKernel/Kernel.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 7fde926bb6..67a02337b5 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,19 +59,11 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; -<<<<<<< HEAD const VERSION = '2.8.24-DEV'; const VERSION_ID = 20824; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; const RELEASE_VERSION = 24; -======= - const VERSION = '2.7.31-DEV'; - const VERSION_ID = 20731; - const MAJOR_VERSION = 2; - const MINOR_VERSION = 7; - const RELEASE_VERSION = 31; ->>>>>>> 2.7 const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; From 0cd605bdea66f91526644582ae02b1435974c8ad Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 5 Jul 2017 12:51:40 +0300 Subject: [PATCH 23/33] updated CHANGELOG for 3.2.11 --- CHANGELOG-3.2.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG-3.2.md b/CHANGELOG-3.2.md index 5542e4160d..de3c3fd997 100644 --- a/CHANGELOG-3.2.md +++ b/CHANGELOG-3.2.md @@ -7,6 +7,11 @@ in 3.2 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.2.0...v3.2.1 +* 3.2.11 (2017-07-05) + + * bug #23390 [Cache] Handle APCu failures gracefully (nicolas-grekas) + * bug #23378 [FrameworkBundle] Do not remove files from assets dir (1ed) + * 3.2.10 (2017-07-04) * bug #23366 [FrameworkBundle] Don't get() private services from debug:router (chalasr) From 99e70b8cc0d7d0c77fb8b17a7ff52862438bdaa1 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 5 Jul 2017 12:51:47 +0300 Subject: [PATCH 24/33] updated VERSION for 3.2.11 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 599cf6da6f..bdfd2b2d9c 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '3.2.11-DEV'; + const VERSION = '3.2.11'; const VERSION_ID = 30211; const MAJOR_VERSION = 3; const MINOR_VERSION = 2; const RELEASE_VERSION = 11; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '07/2017'; const END_OF_LIFE = '01/2018'; From 692acb4d64c1bb5e2b0cb261f546d21fb7ba6dd0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 5 Jul 2017 13:46:19 +0300 Subject: [PATCH 25/33] bumped Symfony version to 3.2.12 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index bdfd2b2d9c..dd6568b989 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '3.2.11'; - const VERSION_ID = 30211; + const VERSION = '3.2.12-DEV'; + const VERSION_ID = 30212; const MAJOR_VERSION = 3; const MINOR_VERSION = 2; - const RELEASE_VERSION = 11; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 12; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '07/2017'; const END_OF_LIFE = '01/2018'; From 70bd2bc41b5146af1f1e07c9159c6b246095d6de Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 5 Jul 2017 15:26:31 +0300 Subject: [PATCH 26/33] [VarDumper] Reduce size of serialized Data objects --- src/Symfony/Component/Debug/ErrorHandler.php | 2 +- .../DataCollector/LoggerDataCollector.php | 3 +- src/Symfony/Component/HttpKernel/Kernel.php | 2 +- .../DataCollector/DumpDataCollectorTest.php | 2 +- .../Component/VarDumper/Cloner/Data.php | 72 ++++++++++++++++++- 5 files changed, 76 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index e25b5a6dd8..369ed26f12 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -414,7 +414,7 @@ class ErrorHandler $errorAsException = self::$silencedErrorCache[$message]; ++$errorAsException->count; } else { - $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), $type, $file, $line, false) : array(); + $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3), $type, $file, $line, false) : array(); $errorAsException = new SilencedErrorContext($type, $file, $line, $lightTrace); } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php index f45f99718d..92fd0da71e 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -120,6 +120,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte $log['priorityName'] = 'DEBUG'; $log['channel'] = '-'; $log['scream'] = false; + unset($log['type'], $log['file'], $log['line'], $log['trace'], $log['trace'], $log['count']); $logs[] = $log; } @@ -251,7 +252,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte } foreach ($containerDeprecationLogs as $deprecationLog) { - $count['deprecation_count'] += $deprecationLog['count']; + $count['deprecation_count'] += $deprecationLog['context']['exception']->count; } ksort($count['priorities']); diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 1a0f2434dc..d6ea3e6f04 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -551,7 +551,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface return; } - $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); // Clean the trace by removing first frames added by the error handler itself. for ($i = 0; isset($backtrace[$i]); ++$i) { if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) { diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php index 9a306e533e..e642e3c337 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php @@ -50,7 +50,7 @@ class DumpDataCollectorTest extends TestCase ); $this->assertEquals($xDump, $dump); - $this->assertStringMatchesFormat('a:3:{i:0;a:5:{s:4:"data";O:39:"Symfony\Component\VarDumper\Cloner\Data":%a', $collector->serialize()); + $this->assertStringMatchesFormat('a:3:{i:0;a:5:{s:4:"data";%c:39:"Symfony\Component\VarDumper\Cloner\Data":%a', $collector->serialize()); $this->assertSame(0, $collector->getDumpsCount()); $this->assertSame('a:2:{i:0;b:0;i:1;s:5:"UTF-8";}', $collector->serialize()); } diff --git a/src/Symfony/Component/VarDumper/Cloner/Data.php b/src/Symfony/Component/VarDumper/Cloner/Data.php index 5a6997cf25..655fae0ca6 100644 --- a/src/Symfony/Component/VarDumper/Cloner/Data.php +++ b/src/Symfony/Component/VarDumper/Cloner/Data.php @@ -16,7 +16,7 @@ use Symfony\Component\VarDumper\Caster\Caster; /** * @author Nicolas Grekas */ -class Data implements \ArrayAccess, \Countable, \IteratorAggregate +class Data implements \ArrayAccess, \Countable, \IteratorAggregate, \Serializable { private $data; private $position = 0; @@ -278,6 +278,57 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate $this->dumpItem($dumper, new Cursor(), $refs, $this->data[$this->position][$this->key]); } + /** + * @internal + */ + public function serialize() + { + $data = $this->data; + + foreach ($data as $i => $values) { + foreach ($values as $k => $v) { + if ($v instanceof Stub) { + if (Stub::TYPE_ARRAY === $v->type) { + $v = self::mapStubConsts($v, false); + $data[$i][$k] = array($v->class, $v->position, $v->cut); + } else { + $v = self::mapStubConsts($v, false); + $data[$i][$k] = array($v->class, $v->position, $v->cut, $v->type, $v->value, $v->handle, $v->refCount, $v->attr); + } + } + } + } + + return serialize(array($data, $this->position, $this->key, $this->maxDepth, $this->maxItemsPerDepth, $this->useRefHandles)); + } + + /** + * @internal + */ + public function unserialize($serialized) + { + list($data, $this->position, $this->key, $this->maxDepth, $this->maxItemsPerDepth, $this->useRefHandles) = unserialize($serialized); + + foreach ($data as $i => $values) { + foreach ($values as $k => $v) { + if ($v && is_array($v)) { + $s = new Stub(); + if (3 === count($v)) { + $s->type = Stub::TYPE_ARRAY; + $s = self::mapStubConsts($s, false); + list($s->class, $s->position, $s->cut) = $v; + $s->value = $s->cut + count($data[$s->position]); + } else { + list($s->class, $s->position, $s->cut, $s->type, $s->value, $s->handle, $s->refCount, $s->attr) = $v; + } + $data[$i][$k] = self::mapStubConsts($s, true); + } + } + } + + $this->data = $data; + } + /** * Depth-first dumping of items. * @@ -406,4 +457,23 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate return $hashCut; } + + private static function mapStubConsts(Stub $stub, $resolve) + { + static $stubConstIndexes, $stubConstValues; + + if (null === $stubConstIndexes) { + $r = new \ReflectionClass(Stub::class); + $stubConstIndexes = array_flip(array_values($r->getConstants())); + $stubConstValues = array_flip($stubConstIndexes); + } + + $map = $resolve ? $stubConstValues : $stubConstIndexes; + + $stub = clone $stub; + $stub->type = $map[$stub->type]; + $stub->class = isset($map[$stub->class]) ? $map[$stub->class] : $stub->class; + + return $stub; + } } From a7c9d1aca075f593dba853a01b1de607f1626a4c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 5 Jul 2017 16:28:05 +0300 Subject: [PATCH 27/33] updated CHANGELOG for 3.3.4 --- CHANGELOG-3.3.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG-3.3.md b/CHANGELOG-3.3.md index 1817eff602..b6113a82ad 100644 --- a/CHANGELOG-3.3.md +++ b/CHANGELOG-3.3.md @@ -7,6 +7,14 @@ in 3.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/v3.3.0...v3.3.1 +* 3.3.4 (2017-07-05) + + * bug #23413 [VarDumper] Reduce size of serialized Data objects (nicolas-grekas) + * bug #23385 [DoctrineBridge] Fix resetting entity managers with case sensitive id (chalasr) + * bug #23390 [Cache] Handle APCu failures gracefully (nicolas-grekas) + * bug #23371 [FrameworkBundle] 3.3: Don't get() private services from debug:router (ogizanagi) + * bug #23378 [FrameworkBundle] Do not remove files from assets dir (1ed) + * 3.3.3 (2017-07-04) * bug #23366 [FrameworkBundle] Don't get() private services from debug:router (chalasr) From e81d5d17d64d4a5885ce2f35c963de2ab7fb02d0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 5 Jul 2017 16:28:15 +0300 Subject: [PATCH 28/33] updated VERSION for 3.3.4 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index d6ea3e6f04..0fc96a0acc 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -61,12 +61,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface private $projectDir; - const VERSION = '3.3.4-DEV'; + const VERSION = '3.3.4'; const VERSION_ID = 30304; const MAJOR_VERSION = 3; const MINOR_VERSION = 3; const RELEASE_VERSION = 4; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2018'; const END_OF_LIFE = '07/2018'; From 94b6ec309259b32db23e2c3f50fcdd2e49d4a982 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 5 Jul 2017 16:59:31 +0300 Subject: [PATCH 29/33] bumped Symfony version to 3.3.5 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 0fc96a0acc..af60ef900a 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -61,12 +61,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface private $projectDir; - const VERSION = '3.3.4'; - const VERSION_ID = 30304; + const VERSION = '3.3.5-DEV'; + const VERSION_ID = 30305; const MAJOR_VERSION = 3; const MINOR_VERSION = 3; - const RELEASE_VERSION = 4; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 5; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2018'; const END_OF_LIFE = '07/2018'; From 052b8c3a04e855bc21323403dc1575c8e4ea0545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 5 Jul 2017 22:19:23 +0200 Subject: [PATCH 30/33] [DI][Security] Prevent unwanted deprecation notices when using Expression Languages --- .../Component/DependencyInjection/ExpressionLanguage.php | 6 ++++-- .../Security/Core/Authorization/ExpressionLanguage.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/ExpressionLanguage.php b/src/Symfony/Component/DependencyInjection/ExpressionLanguage.php index acc97bcf49..d80985fa67 100644 --- a/src/Symfony/Component/DependencyInjection/ExpressionLanguage.php +++ b/src/Symfony/Component/DependencyInjection/ExpressionLanguage.php @@ -12,7 +12,6 @@ namespace Symfony\Component\DependencyInjection; use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage; -use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface; /** * Adds some function to the default ExpressionLanguage. @@ -23,7 +22,10 @@ use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface; */ class ExpressionLanguage extends BaseExpressionLanguage { - public function __construct(ParserCacheInterface $cache = null, array $providers = array()) + /** + * {@inheritdoc} + */ + public function __construct($cache = null, array $providers = array()) { // prepend the default provider to let users override it easily array_unshift($providers, new ExpressionLanguageProvider()); diff --git a/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php b/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php index c2925af871..d4c8f33e06 100644 --- a/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php +++ b/src/Symfony/Component/Security/Core/Authorization/ExpressionLanguage.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Security\Core\Authorization; use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage; -use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface; /** * Adds some function to the default ExpressionLanguage. @@ -23,7 +22,10 @@ use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface; */ class ExpressionLanguage extends BaseExpressionLanguage { - public function __construct(ParserCacheInterface $cache = null, array $providers = array()) + /** + * {@inheritdoc} + */ + public function __construct($cache = null, array $providers = array()) { // prepend the default provider to let users override it easily array_unshift($providers, new ExpressionLanguageProvider()); From bbd0c7f69f49aea44ce0c5aa63cc3cd1a6efc284 Mon Sep 17 00:00:00 2001 From: Dany Maillard Date: Thu, 6 Jul 2017 09:01:40 +0200 Subject: [PATCH 31/33] Fix deprecated message --- UPGRADE-4.0.md | 2 +- src/Symfony/Component/Ldap/Adapter/RenameEntryInterface.php | 4 ++-- src/Symfony/Component/Ldap/CHANGELOG.md | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index b06145202e..3ce678b866 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -402,7 +402,7 @@ HttpKernel Ldap ---- - * The `RenameEntryInterface` has been deprecated, and merged with `EntryManagerInterface` + * The `RenameEntryInterface` has been removed, and merged with `EntryManagerInterface` Process ------- diff --git a/src/Symfony/Component/Ldap/Adapter/RenameEntryInterface.php b/src/Symfony/Component/Ldap/Adapter/RenameEntryInterface.php index 8bc70bda96..c15cb16e77 100644 --- a/src/Symfony/Component/Ldap/Adapter/RenameEntryInterface.php +++ b/src/Symfony/Component/Ldap/Adapter/RenameEntryInterface.php @@ -5,9 +5,9 @@ namespace Symfony\Component\Ldap\Adapter; use Symfony\Component\Ldap\Entry; /** - * @deprecated This interface will be deprecated in 4.0, and merged with `EntryManagerInterface` - * * @author Kevin Schuurmans + * + * @deprecated since version 3.3, will be merged with {@link EntryManagerInterface} in 4.0. */ interface RenameEntryInterface { diff --git a/src/Symfony/Component/Ldap/CHANGELOG.md b/src/Symfony/Component/Ldap/CHANGELOG.md index 61af4adf15..5d90f278f5 100644 --- a/src/Symfony/Component/Ldap/CHANGELOG.md +++ b/src/Symfony/Component/Ldap/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +3.3.0 +----- + +* The `RenameEntryInterface` inferface is deprecated, and will be merged with `EntryManagerInterface` in 4.0. + 3.1.0 ----- From 43212b9a90b9af1ae14c6851dd98b48038049934 Mon Sep 17 00:00:00 2001 From: Miroslav Sustek Date: Fri, 14 Apr 2017 20:04:38 +0200 Subject: [PATCH 32/33] [DX] [TwigBundle] Enhance the new exception page design --- .../Resources/views/Exception/trace.html.twig | 41 +++++++-------- .../views/Exception/traces.html.twig | 50 +++++++++---------- .../Resources/views/exception.css.twig | 14 ++++-- 3 files changed, 53 insertions(+), 52 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig index a6af5d0532..1d8125a38f 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig @@ -1,28 +1,29 @@ -{% if trace.file|default(false) %} - {{ include('@Twig/images/icon-minus-square.svg') }} - {{ include('@Twig/images/icon-plus-square.svg') }} -{% endif %} +
+ {% if trace.file|default(false) %} + {{ include('@Twig/images/icon-minus-square.svg') }} + {{ include('@Twig/images/icon-plus-square.svg') }} + {% endif %} -{% if trace.function %} - {{ trace.class|abbr_class }}{% if trace.type is not empty %}{{ trace.type }}{% endif %}{{ trace.function }}({{ trace.args|format_args }}) -{% endif %} + {% if trace.function %} + {{ trace.class|abbr_class }}{% if trace.type is not empty %}{{ trace.type }}{% endif %}{{ trace.function }}({{ trace.args|format_args }}) + {% endif %} -{% if trace.file|default(false) %} - {% set line_number = trace.line|default(1) %} - {% set file_link = trace.file|file_link(line_number) %} - {% set file_path = trace.file|format_file(line_number)|striptags|replace({ (' at line ' ~ line_number): '' }) %} - {% set file_path_parts = file_path|split(constant('DIRECTORY_SEPARATOR')) %} - - - in - {{ file_path_parts[:-1]|join(constant('DIRECTORY_SEPARATOR')) }}{{ constant('DIRECTORY_SEPARATOR') }}{{ file_path_parts|last }} - (line {{ line_number }}) - -{% endif %} + {% if trace.file|default(false) %} + {% set line_number = trace.line|default(1) %} + {% set file_link = trace.file|file_link(line_number) %} + {% set file_path = trace.file|format_file(line_number)|striptags|replace({ (' at line ' ~ line_number): '' }) %} + {% set file_path_parts = file_path|split(constant('DIRECTORY_SEPARATOR')) %} + + in + {{ file_path_parts[:-1]|join(constant('DIRECTORY_SEPARATOR')) }}{{ constant('DIRECTORY_SEPARATOR') }}{{ file_path_parts|last }} + (line {{ line_number }}) + + {% endif %} +
{% if trace.file|default(false) %}
- {{ trace.file|file_excerpt(trace.line)|replace({ + {{ trace.file|file_excerpt(trace.line, 5)|replace({ '#DD0000': '#183691', '#007700': '#a71d5d', '#0000BB': '#222222', diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig index 948ee86fa6..2bf3e7613a 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig @@ -1,37 +1,33 @@
- - - - - - + {% if exception.message is not empty and index > 1 %} +

{{ exception.message }}

+ {% endif %} + + - +
{% set _is_first_user_code = true %} {% for i, trace in exception.trace %} {% set _display_code_snippet = _is_first_user_code and ('/vendor/' not in trace.file) and ('/var/cache/' not in trace.file) and (trace.file is not empty) %} {% if _display_code_snippet %}{% set _is_first_user_code = false %}{% endif %} -
- - +
+ {{ include('@Twig/Exception/trace.html.twig', { prefix: index, i: i, trace: trace, _display_code_snippet: _display_code_snippet }, with_context = false) }} +
{% endfor %} - -
-

- - {{ exception.class|split('\\')|slice(0, -1)|join('\\') }} - {{- exception.class|split('\\')|length > 1 ? '\\' }} - - {{ exception.class|split('\\')|last }} +
+
+ +

+ + {{ exception.class|split('\\')|slice(0, -1)|join('\\') }} + {{- exception.class|split('\\')|length > 1 ? '\\' }} + + {{ exception.class|split('\\')|last }} - {{ include('@Twig/images/icon-minus-square-o.svg') }} - {{ include('@Twig/images/icon-plus-square-o.svg') }} -

+ {{ include('@Twig/images/icon-minus-square-o.svg') }} + {{ include('@Twig/images/icon-plus-square-o.svg') }} +

- {% if exception.message is not empty and index > 1 %} -

{{ exception.message }}

- {% endif %} -
- {{ include('@Twig/Exception/trace.html.twig', { prefix: index, i: i, trace: trace }, with_context = false) }} -
+
+
diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig index cb455274ee..ba3dd9412e 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig @@ -89,30 +89,34 @@ header .container { display: flex; justify-content: space-between; } .exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; } .trace + .trace { margin-top: 30px; } +.trace-head { background-color: #e0e0e0; padding: 10px; } .trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; } .trace-head .trace-namespace { color: #999; display: block; font-size: 13px; } .trace-head .icon { position: absolute; right: 0; top: 0; } .trace-head .icon svg { height: 24px; width: 24px; } +.trace-details { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; } + .trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; } .trace-details { table-layout: fixed; } -.trace-line { position: relative; padding-left: 36px; } -.trace-line.sf-toggle:hover { background: #F5F5F5; } +.trace-line { position: relative; padding-top: 8px; padding-bottom: 8px; } +.trace-line:hover { background: #F5F5F5; } .trace-line a { color: #222; } .trace-line .icon { opacity: .4; position: absolute; left: 10px; top: 11px; } .trace-line .icon svg { height: 16px; width: 16px; } +.trace-line-header { padding-left: 36px; } -.trace-file-path, .trace-file-path a { margin-top: 3px; color: #999; color: #795da3; color: #B0413E; color: #222; font-size: 13px; } +.trace-file-path, .trace-file-path a { color: #999; color: #795da3; color: #B0413E; color: #222; font-size: 13px; } .trace-class { color: #B0413E; } .trace-type { padding: 0 2px; } .trace-method { color: #B0413E; color: #222; font-weight: bold; color: #B0413E; } .trace-arguments { color: #222; color: #999; font-weight: normal; color: #795da3; color: #777; padding-left: 2px; } -.trace-code { background: #FFF; font-size: 12px; margin: 10px 0 2px; padding: 10px; overflow-x: auto; } +.trace-code { background: #FFF; font-size: 12px; margin: 10px 10px 2px 10px; padding: 10px; overflow-x: auto; white-space: nowrap; } .trace-code ol { margin: 0; float: left; } .trace-code li { color: #969896; margin: 0; padding-left: 10px; float: left; width: 100%; } .trace-code li + li { margin-top: 5px; } -.trace-code li.selected { background: #F8EEC7; padding: 3px 0 3px 10px; margin-top: 2px; } +.trace-code li.selected { background: #F7E5A1; margin-top: 2px; } .trace-code li code { color: #222; white-space: nowrap; } .trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; } From 73187d00034678158a3ccbd7015cc1509a2ab7fc Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Thu, 6 Jul 2017 10:48:01 +0200 Subject: [PATCH 33/33] Preserve HttpOnly value when deserializing a header The specification states that the cookie should be considered http only if and only if the flag is present. See https://www.owasp.org/index.php/HttpOnly --- src/Symfony/Component/HttpFoundation/Cookie.php | 2 +- .../Component/HttpFoundation/Tests/CookieTest.php | 11 ++++++++++- .../HttpFoundation/Tests/ResponseHeaderBagTest.php | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Cookie.php b/src/Symfony/Component/HttpFoundation/Cookie.php index 2ac902685d..915bc11a5d 100644 --- a/src/Symfony/Component/HttpFoundation/Cookie.php +++ b/src/Symfony/Component/HttpFoundation/Cookie.php @@ -46,7 +46,7 @@ class Cookie 'path' => '/', 'domain' => null, 'secure' => false, - 'httponly' => true, + 'httponly' => false, 'raw' => !$decode, 'samesite' => null, ); diff --git a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php index edaed2533b..a79776a2a9 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php @@ -200,6 +200,15 @@ class CookieTest extends TestCase $this->assertEquals(new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true, true, true), $cookie); $cookie = Cookie::fromString('foo=bar', true); - $this->assertEquals(new Cookie('foo', 'bar'), $cookie); + $this->assertEquals(new Cookie('foo', 'bar', 0, '/', null, false, false), $cookie); + } + + public function testFromStringWithHttpOnly() + { + $cookie = Cookie::fromString('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly'); + $this->assertTrue($cookie->isHttpOnly()); + + $cookie = Cookie::fromString('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure'); + $this->assertFalse($cookie->isHttpOnly()); } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php index 724328ae85..4136567214 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php @@ -241,12 +241,12 @@ class ResponseHeaderBagTest extends TestCase { $bag = new ResponseHeaderBag(); $bag->set('set-cookie', 'foo=bar'); - $this->assertEquals(array(new Cookie('foo', 'bar', 0, '/', null, false, true, true)), $bag->getCookies()); + $this->assertEquals(array(new Cookie('foo', 'bar', 0, '/', null, false, false, true)), $bag->getCookies()); $bag->set('set-cookie', 'foo2=bar2', false); $this->assertEquals(array( - new Cookie('foo', 'bar', 0, '/', null, false, true, true), - new Cookie('foo2', 'bar2', 0, '/', null, false, true, true), + new Cookie('foo', 'bar', 0, '/', null, false, false, true), + new Cookie('foo2', 'bar2', 0, '/', null, false, false, true), ), $bag->getCookies()); $bag->remove('set-cookie');