From f7f81892a0df39e27d75a47cec74806a49b93f0f Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 20 Mar 2018 15:40:39 +0100 Subject: [PATCH 01/18] Fix check of color support on Windows If the stream is redirected, the script should behave the same on Windows and on POSIX systems. --- .../Component/Console/Output/StreamOutput.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index d36e6f9560159..182622a29a5c8 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -81,17 +81,26 @@ protected function doWrite($message, $newline) * * Colorization is disabled if not supported by the stream: * - * - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty + * - the stream is redirected (eg php file.php >log) + * - Windows without VT100 support, Ansicon, ConEmu, Mintty * - non tty consoles * * @return bool true if the stream supports colorization, false otherwise */ protected function hasColorSupport() { + if (function_exists('stream_isatty') && !@stream_isatty($this->stream)) { + return false; + } if (DIRECTORY_SEPARATOR === '\\') { + if (function_exists('sapi_windows_vt100_support')) { + $vt100Enabled = @sapi_windows_vt100_support($this->stream); + } else { + $vt100Enabled = '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD; + } + return - function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support($this->stream) - || '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD + $vt100Enabled || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM'); From 910ec3a3b21705ee29f40f816a05f20d45b05505 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 2 Apr 2018 11:53:08 +0200 Subject: [PATCH 02/18] updated CHANGELOG for 2.7.44 --- CHANGELOG-2.7.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG-2.7.md b/CHANGELOG-2.7.md index 2d7bfd9f74dd6..70677f3d18e3d 100644 --- a/CHANGELOG-2.7.md +++ b/CHANGELOG-2.7.md @@ -7,6 +7,27 @@ 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.44 (2018-04-02) + + * bug #26727 [HttpCache] Unlink tmp file on error (Chansig) + * bug #26675 [HttpKernel] DumpDataCollector: do not flush when a dumper is provided (ogizanagi) + * bug #26663 [TwigBridge] Fix rendering of currency by MoneyType (ro0NL) + * bug #26677 Support phpdbg SAPI in Debug::enable() (hkdobrev) + * bug #26621 [Form] no type errors with invalid submitted data types (xabbuh) + * bug #26337 [Finder] Fixed leading/trailing / in filename (lyrixx) + * bug #26584 [TwigBridge] allow html5 compatible rendering of forms with null names (systemist) + * bug #24401 [Form] Change datetime to datetime-local for HTML5 datetime input (pierredup) + * bug #26370 [Security] added userChecker to SimpleAuthenticationProvider (i3or1s) + * bug #26569 [BrowserKit] Fix cookie path handling when $domain is null (dunglas) + * bug #26598 Fixes #26563 (open_basedir restriction in effect) (temperatur) + * bug #26568 [Debug] Reset previous exception handler earlier to prevent infinite loop (nicolas-grekas) + * bug #26567 [DoctrineBridge] Don't rely on ClassMetadataInfo->hasField in DoctrineOrmTypeGuesser anymore (fancyweb) + * bug #26356 [FrameworkBundle] HttpCache is not longer abstract (lyrixx) + * bug #26548 [DomCrawler] Change bad wording in ChoiceFormField::untick (dunglas) + * bug #26433 [DomCrawler] extract(): fix a bug when the attribute list is empty (dunglas) + * bug #26452 [Intl] Load locale aliases to support alias fallbacks (jakzal) + * bug #26450 [CssSelector] Fix CSS identifiers parsing - they can start with dash (jakubkulhan) + * 2.7.43 (2018-03-05) * bug #26368 [WebProfilerBundle] Fix Debug toolbar breaks app (xkobal) From 1f53736f83b070710a81efe577553a3974082439 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 2 Apr 2018 11:53:22 +0200 Subject: [PATCH 03/18] update CONTRIBUTORS for 2.7.44 --- CONTRIBUTORS.md | 66 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1034172772791..1cb4373ec2030 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -27,8 +27,8 @@ Symfony is the result of the work of many people who made the code better - Pascal Borreli (pborreli) - Wouter De Jong (wouterj) - Joseph Bielawski (stloyd) - - Karma Dordrak (drak) - Roland Franssen (ro0) + - Karma Dordrak (drak) - Lukas Kahwe Smith (lsmith) - Martin Hasoň (hason) - Jeremy Mikola (jmikola) @@ -40,10 +40,10 @@ Symfony is the result of the work of many people who made the code better - Guilhem Niot (energetick) - Sarah Khalil (saro0h) - Jonathan Wage (jwage) + - Hamza Amrouche (simperfit) - Diego Saint Esteben (dosten) - Alexandre Salomé (alexandresalome) - William Durand (couac) - - Hamza Amrouche (simperfit) - ornicar - Francis Besset (francisbesset) - Iltar van der Berg (kjarli) @@ -54,19 +54,20 @@ Symfony is the result of the work of many people who made the code better - Peter Rehm (rpet) - Saša Stamenković (umpirsky) - Matthias Pigulla (mpdude) + - Samuel ROZE (sroze) - Henrik Bjørnskov (henrikbjorn) + - Dany Maillard (maidmaid) - Miha Vrhovnik - - Diego Saint Esteben (dii3g0) - Pierre du Plessis (pierredup) - - Dany Maillard (maidmaid) + - Tobias Nyholm (tobias) + - Diego Saint Esteben (dii3g0) - Konstantin Kudryashov (everzet) - Kevin Bond (kbond) - Bilal Amarni (bamarni) - Alexander M. Turek (derrabus) - Jérémy DERUSSÉ (jderusse) - Florin Patan (florinpatan) - - Samuel ROZE (sroze) - - Tobias Nyholm (tobias) + - Mathieu Piot (mpiot) - Gábor Egyed (1ed) - Michel Weimerskirch (mweimerskirch) - Andrej Hudec (pulzarraider) @@ -97,9 +98,9 @@ Symfony is the result of the work of many people who made the code better - Antoine Hérault (herzult) - Paráda József (paradajozsef) - David Maicher (dmaicher) + - Vladimir Reznichenko (kalessil) - Arnaud Le Blanc (arnaud-lb) - Maxime STEINHAUSSER - - Vladimir Reznichenko (kalessil) - Michal Piotrowski (eventhorizon) - Tim Nagel (merk) - Brice BERNARD (brikou) @@ -143,22 +144,23 @@ Symfony is the result of the work of many people who made the code better - Jérôme Vasseur (jvasseur) - Jérémie Augustin (jaugustin) - Andréia Bohner (andreia) + - Philipp Wahala (hifi) - Julien Falque (julienfalque) - Rafael Dohms (rdohms) - Arnaud Kleinpeter (nanocom) - jwdeitch - Mikael Pajunen - Joel Wurtz (brouznouf) + - Valentin Udaltsov (vudaltsov) - Chris Wilkinson (thewilkybarkid) - Oleg Voronkovich - - Philipp Wahala (hifi) - Vyacheslav Pavlov - Richard van Laak (rvanlaak) - Richard Shank (iampersistent) - Thomas Rabaix (rande) + - gadelat (gadelat) - Rouven Weßling (realityking) - Teoh Han Hui (teohhanhui) - - Valentin Udaltsov (vudaltsov) - Clemens Tolboom - Helmer Aaviksoo - Hiromi Hishida (77web) @@ -171,6 +173,7 @@ Symfony is the result of the work of many people who made the code better - GDIBass - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) - James Halsall (jaitsu) + - Matthieu Napoli (mnapoli) - Gabriel Caruso - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) @@ -180,10 +183,10 @@ Symfony is the result of the work of many people who made the code better - Dorian Villet (gnutix) - Sergey Linnik (linniksa) - Richard Miller (mr_r_miller) + - Gabriel Ostrolucký - Mario A. Alvarez Garcia (nomack84) - Dennis Benkert (denderello) - SpacePossum - - Matthieu Napoli (mnapoli) - Benjamin Dulau (dbenjamin) - Mathieu Lemoine (lemoinem) - Christian Schmidt @@ -194,7 +197,6 @@ Symfony is the result of the work of many people who made the code better - bronze1man - sun (sun) - Larry Garfield (crell) - - Gabriel Ostrolucký - Martin Schuhfuß (usefulthink) - apetitpa - Matthieu Bontemps (mbontemps) @@ -216,6 +218,7 @@ Symfony is the result of the work of many people who made the code better - Michele Orselli (orso) - Tom Van Looy (tvlooy) - Sven Paulus (subsven) + - Thomas Calvet (fancyweb) - Rui Marinho (ruimarinho) - Niels Keurentjes (curry684) - Eugene Wissner @@ -223,7 +226,6 @@ Symfony is the result of the work of many people who made the code better - Tristan Darricau (nicofuma) - Michaël Perrin (michael.perrin) - Marcel Beerta (mazen) - - gadelat (gadelat) - Loïc Faugeron - Hidde Wieringa (hiddewie) - Marco Pivetta (ocramius) @@ -242,14 +244,15 @@ Symfony is the result of the work of many people who made the code better - Danny Berger (dpb587) - Ruben Gonzalez (rubenrua) - Adam Prager (padam87) + - Benoît Burnichon (bburnichon) - Roman Marintšenko (inori) - Xavier Montaña Carreras (xmontana) - Mickaël Andrieu (mickaelandrieu) - Xavier Perez - Arjen Brouwer (arjenjb) - Katsuhiro OGAWA - - Thomas Calvet (fancyweb) - Patrick McDougle (patrick-mcdougle) + - Yanick Witschi (toflar) - Alif Rachmawadi - Alessandro Chitolina - Kristen Gilden (kgilden) @@ -288,7 +291,6 @@ Symfony is the result of the work of many people who made the code better - Robert Kiss (kepten) - Roumen Damianoff (roumen) - Antonio J. García Lagar (ajgarlag) - - Benoît Burnichon (bburnichon) - Kim Hemsø Rasmussen (kimhemsoe) - Wouter Van Hecke - Jérôme Parmentier (lctrs) @@ -297,7 +299,6 @@ Symfony is the result of the work of many people who made the code better - Michael Holm (hollo) - Marc Weistroff (futurecat) - Christian Schmidt - - Yanick Witschi (toflar) - Edi Modrić (emodric) - Chad Sikorra (chadsikorra) - Chris Smith (cs278) @@ -331,6 +332,7 @@ Symfony is the result of the work of many people who made the code better - janschoenherr - Thomas Schulz (king2500) - Dariusz Rumiński + - Frank de Jonge (frenkynet) - Berny Cantos (xphere81) - Thierry Thuon (lepiaf) - Ricard Clau (ricardclau) @@ -349,6 +351,7 @@ Symfony is the result of the work of many people who made the code better - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Tomasz Kowalczyk (thunderer) + - Artur Eshenbrener - François-Xavier de Guillebon (de-gui_f) - Damien Alexandre (damienalexandre) - Felix Labrecque @@ -368,6 +371,7 @@ Symfony is the result of the work of many people who made the code better - Philipp Kräutli (pkraeutli) - Kirill chEbba Chebunin (chebba) - Greg Thornton (xdissent) + - Florent Mata (fmata) - Costin Bereveanu (schniper) - Loïc Chardonnet (gnusat) - Marek Kalnik (marekkalnik) @@ -408,7 +412,6 @@ Symfony is the result of the work of many people who made the code better - Emanuele Gaspari (inmarelibero) - Sébastien Santoro (dereckson) - Brian King - - Frank de Jonge (frenkynet) - Michel Salib (michelsalib) - geoffrey - Steffen Roßkamp @@ -446,7 +449,6 @@ Symfony is the result of the work of many people who made the code better - Marek Pietrzak - Luc Vieillescazes (iamluc) - franek (franek) - - Artur Eshenbrener - Christian Wahler - Gintautas Miselis - Rob Bast @@ -482,7 +484,6 @@ Symfony is the result of the work of many people who made the code better - Roy Van Ginneken (rvanginneken) - ondrowan - Barry vd. Heuvel (barryvdh) - - Florent Mata - Evan S Kaufman (evanskaufman) - mcben - Jérôme Vieilledent (lolautruche) @@ -550,11 +551,13 @@ Symfony is the result of the work of many people who made the code better - Michiel Boeckaert (milio) - Geoffrey Tran (geoff) - Romain Pierre (romain-pierre) + - David Prévot - Jan Behrens - Mantas Var (mvar) - Sebastian Krebs - Jean-Christophe Cuvelier [Artack] - alcaeus + - Fred Cox - vitaliytv - Dalibor Karlović (dkarlovi) - Sebastian Blum @@ -585,6 +588,7 @@ Symfony is the result of the work of many people who made the code better - Javier López (loalf) - Reinier Kip - Geoffrey Brier (geoffrey-brier) + - Boris Vujicic (boris.vujicic) - Dustin Dobervich (dustin10) - dantleech - Anne-Sophie Bachelard (annesophie) @@ -685,6 +689,7 @@ Symfony is the result of the work of many people who made the code better - Joshua Nye - Claudio Zizza - Dave Marshall (davedevelopment) + - Jakub Kulhan (jakubkulhan) - avorobiev - Venu - Lars Vierbergen @@ -750,6 +755,7 @@ Symfony is the result of the work of many people who made the code better - Sofiane HADDAG (sofhad) - frost-nzcr4 - Bozhidar Hristov + - andrey1s - Abhoryo - Fabian Vogler (fabian) - Korvin Szanto @@ -848,6 +854,7 @@ Symfony is the result of the work of many people who made the code better - Mátyás Somfai (smatyas) - stefan.r - Valérian Galliat + - d-ph - Rikijs Murgs - Ben Ramsey (ramsey) - Amaury Leroux de Lens (amo__) @@ -923,17 +930,16 @@ Symfony is the result of the work of many people who made the code better - AKeeman (akeeman) - Lin Clark - Jeremy David (jeremy.david) + - Gocha Ossinkine (ossinkine) - Troy McCabe - Ville Mattila - ilyes kooli - gr1ev0us - mlazovla - - Boris Vujicic (boris.vujicic) - Max Beutel - Antanas Arvasevicius - Maximilian Berghoff (electricmaxxx) - nacho - - Mathieu Piot - Piotr Antosik (antek88) - Artem Lopata - Sergey Novikov (s12v) @@ -980,10 +986,12 @@ Symfony is the result of the work of many people who made the code better - Jhonny Lidfors (jhonny) - Julien Bianchi (jubianchi) - Robert Meijers + - James Sansbury - Marcin Chwedziak - hjkl - Tony Cosentino (tony-co) - Dan Wilga + - Andrew Tch - Alexander Cheprasov - Rodrigo Díez Villamuera (rodrigodiez) - Malte Blättermann @@ -1069,7 +1077,6 @@ Symfony is the result of the work of many people who made the code better - Sergey Yuferev - Tobias Stöckler - Mario Young - - Jakub Kulhan - Ilia (aliance) - Mo Di (modi) - Pablo Schläpfer @@ -1151,6 +1158,7 @@ Symfony is the result of the work of many people who made the code better - Andreas Frömer - Philip Frank - Lance McNearney + - Antoine M (amakdessi) - Gonzalo Vilaseca (gonzalovilaseca) - Giorgio Premi - Ian Carroll @@ -1217,6 +1225,7 @@ Symfony is the result of the work of many people who made the code better - Qingshan Luo - Ergie Gonzaga - Matthew J Mucklo + - AnrDaemon - fdgdfg (psampaz) - Stéphane Seng - Maxwell Vandervelde @@ -1282,6 +1291,7 @@ Symfony is the result of the work of many people who made the code better - Przemysław Piechota (kibao) - Leonid Terentyev (li0n) - ryunosuke + - zenmate - victoria - Christian Schmidt - Francisco Facioni (fran6co) @@ -1305,6 +1315,7 @@ Symfony is the result of the work of many people who made the code better - Vasily Khayrulin (sirian) - Stefan Koopmanschap (skoop) - Stefan Hüsges (tronsha) + - Jake Bishop (yakobeyak) - Dan Blows - Matt Wells - Nicolas Appriou @@ -1397,7 +1408,6 @@ Symfony is the result of the work of many people who made the code better - Artem Lopata (bumz) - Nicole Cordes - Roman Orlov - - andrey1s - VolCh - Alexey Popkov - Gijs Kunze @@ -1408,6 +1418,7 @@ Symfony is the result of the work of many people who made the code better - Daan van Renterghem - Nicole Cordes - Martin Kirilov + - amcastror - Bram Van der Sype (brammm) - Guile (guile) - Julien Moulin (lizjulien) @@ -1485,6 +1496,7 @@ Symfony is the result of the work of many people who made the code better - grifx - Robert Campbell - Matt Lehner + - Helmut Januschka - Hein Zaw Htet™ - Ruben Kruiswijk - Cosmin-Romeo TANASE @@ -1495,12 +1507,15 @@ Symfony is the result of the work of many people who made the code better - hadriengem - timaschew - Jochen Mandl + - Marin Nicolae + - Alessandro Loffredo - Ian Phillips - Haritz - Matthieu Prat - Ion Bazan - Grummfy - Filipe Guerra + - Jean Ragouin - Gerben Wijnja - Rowan Manning - Per Modin @@ -1615,6 +1630,7 @@ Symfony is the result of the work of many people who made the code better - Ron Gähler - Edwin Hageman - Mantas Urnieža + - temperatur - Cas - Dusan Kasan - Myke79 @@ -1646,6 +1662,7 @@ Symfony is the result of the work of many people who made the code better - Jörg Rühl - wesleyh - sergey + - Daniel Bannert - Karim Miladi - Michael Genereux - patrick-mcdougle @@ -1670,8 +1687,10 @@ Symfony is the result of the work of many people who made the code better - Guillaume Aveline - Adrian Philipp - James Michael DuPont + - Tim Goudriaan - Kasperki - Tammy D + - Daniel STANCU - Ondrej Slinták - vlechemin - Brian Corrigan @@ -1704,12 +1723,14 @@ Symfony is the result of the work of many people who made the code better - Elan Ruusamäe - Thorsten Hallwas - Michael Squires + - Egor Gorbachev - Derek Stephen McLean - Norman Soetbeer - zorn - Yuriy Potemkin - Benjamin Long - Matt Janssen + - Ben Miller - Peter Gribanov - Ben Johnson - kwiateusz @@ -1858,6 +1879,7 @@ Symfony is the result of the work of many people who made the code better - drublic - Andreas Streichardt - Pascal Hofmann + - Stefan Kruppa - smokeybear87 - Gustavo Adrian - Kevin Weber From ef8a14154ad6f9da75bd06322ceb9d82aba46719 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 2 Apr 2018 11:53:22 +0200 Subject: [PATCH 04/18] updated VERSION for 2.7.44 --- 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 ff57c10b47341..6867adf518b91 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.44-DEV'; + const VERSION = '2.7.44'; const VERSION_ID = 20744; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; const RELEASE_VERSION = 44; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From 3758a3b1b32e4ed666267cf0d6211db5929af494 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 2 Apr 2018 13:31:07 +0200 Subject: [PATCH 05/18] bumped Symfony version to 2.7.45 --- 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 6867adf518b91..687760865b6ea 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.44'; - const VERSION_ID = 20744; + const VERSION = '2.7.45-DEV'; + const VERSION_ID = 20745; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; - const RELEASE_VERSION = 44; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 45; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From 9fcb4cd0b17b51afda8c3161ad5e14c630abf5a0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 2 Apr 2018 13:53:17 +0200 Subject: [PATCH 06/18] bumped Symfony version to 2.8.38 --- 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 aba3e3c55bf39..defbf43974e42 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.37'; - const VERSION_ID = 20837; + const VERSION = '2.8.38-DEV'; + const VERSION_ID = 20838; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; - const RELEASE_VERSION = 37; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 38; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From 60dd79c8359f126fff42a2d5931229dcee9849d7 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Tue, 3 Apr 2018 01:34:16 +0300 Subject: [PATCH 07/18] Add PHPDbg support to HTTP components --- src/Symfony/Component/Debug/Debug.php | 2 +- src/Symfony/Component/HttpFoundation/Response.php | 2 +- .../Component/HttpKernel/DataCollector/DumpDataCollector.php | 2 +- src/Symfony/Component/Process/PhpExecutableFinder.php | 2 +- src/Symfony/Component/VarDumper/VarDumper.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Debug/Debug.php b/src/Symfony/Component/Debug/Debug.php index 1e29d45826d66..9ae3496b3eb81 100644 --- a/src/Symfony/Component/Debug/Debug.php +++ b/src/Symfony/Component/Debug/Debug.php @@ -45,7 +45,7 @@ public static function enable($errorReportingLevel = null, $displayErrors = true error_reporting(-1); } - if (!in_array(PHP_SAPI, array('cli', 'phpdbg'))) { + if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) { ini_set('display_errors', 0); ExceptionHandler::register(); } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) { diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 4aabc0da236b1..a7459224c2a95 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -372,7 +372,7 @@ public function send() if (function_exists('fastcgi_finish_request')) { fastcgi_finish_request(); - } elseif ('cli' !== PHP_SAPI) { + } elseif (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) { static::closeOutputBuffers(0, true); } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php index a3880a6e8bb32..8c312aaf09b2b 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php @@ -246,7 +246,7 @@ public function __destruct() --$i; } - if ('cli' !== PHP_SAPI && stripos($h[$i], 'html')) { + if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html')) { $this->dumper = new HtmlDumper('php://output', $this->charset); } else { $this->dumper = new CliDumper('php://output', $this->charset); diff --git a/src/Symfony/Component/Process/PhpExecutableFinder.php b/src/Symfony/Component/Process/PhpExecutableFinder.php index 9b3b0f4f68337..f5c97d6bb9f8f 100644 --- a/src/Symfony/Component/Process/PhpExecutableFinder.php +++ b/src/Symfony/Component/Process/PhpExecutableFinder.php @@ -44,7 +44,7 @@ public function find($includeArgs = true) } // PHP_BINARY return the current sapi executable - if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'))) { + if (defined('PHP_BINARY') && PHP_BINARY && \in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), true)) { return PHP_BINARY.$args; } diff --git a/src/Symfony/Component/VarDumper/VarDumper.php b/src/Symfony/Component/VarDumper/VarDumper.php index 1f5ddc5b26ab2..0241486de4e51 100644 --- a/src/Symfony/Component/VarDumper/VarDumper.php +++ b/src/Symfony/Component/VarDumper/VarDumper.php @@ -29,7 +29,7 @@ public static function dump($var) { if (null === self::$handler) { $cloner = new VarCloner(); - $dumper = in_array(PHP_SAPI, array('cli', 'phpdbg')) ? new CliDumper() : new HtmlDumper(); + $dumper = \in_array(PHP_SAPI, array('cli', 'phpdbg'), true) ? new CliDumper() : new HtmlDumper(); self::$handler = function ($var) use ($cloner, $dumper) { $dumper->dump($cloner->cloneVar($var)); }; From cdde6d9353b7eefd487389f3da3958981af73554 Mon Sep 17 00:00:00 2001 From: Helmut Hummel Date: Tue, 3 Apr 2018 13:22:20 +0200 Subject: [PATCH 08/18] [Finder] Remove duplicate slashes in filenames --- src/Symfony/Component/Finder/Finder.php | 16 +++++++- src/Symfony/Component/Finder/SplFileInfo.php | 2 +- .../Component/Finder/Tests/FinderTest.php | 39 +++++++++++++++---- .../Tests/Iterator/FilePathsIteratorTest.php | 2 +- 4 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php index 8eb75fca62a42..8ebba9b9c650c 100644 --- a/src/Symfony/Component/Finder/Finder.php +++ b/src/Symfony/Component/Finder/Finder.php @@ -629,9 +629,9 @@ public function in($dirs) foreach ((array) $dirs as $dir) { if (is_dir($dir)) { - $resolvedDirs[] = $dir; + $resolvedDirs[] = $this->normalizeDir($dir); } elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) { - $resolvedDirs = array_merge($resolvedDirs, $glob); + $resolvedDirs = array_merge($resolvedDirs, array_map(array($this, 'normalizeDir'), $glob)); } else { throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir)); } @@ -794,4 +794,16 @@ private function resetAdapterSelection() return $properties; }, $this->adapters); } + + /** + * Normalizes given directory names by removing trailing slashes. + * + * @param string $dir + * + * @return string + */ + private function normalizeDir($dir) + { + return rtrim($dir, '/'.\DIRECTORY_SEPARATOR); + } } diff --git a/src/Symfony/Component/Finder/SplFileInfo.php b/src/Symfony/Component/Finder/SplFileInfo.php index 2cf3a27fa9f6b..19f95e26be69a 100644 --- a/src/Symfony/Component/Finder/SplFileInfo.php +++ b/src/Symfony/Component/Finder/SplFileInfo.php @@ -28,7 +28,7 @@ class SplFileInfo extends \SplFileInfo */ public function __construct($file, $relativePath, $relativePathname) { - parent::__construct(realpath($file) ?: $file); + parent::__construct($file); $this->relativePath = $relativePath; $this->relativePathname = $relativePathname; } diff --git a/src/Symfony/Component/Finder/Tests/FinderTest.php b/src/Symfony/Component/Finder/Tests/FinderTest.php index dd90c4e844b86..b240728c96810 100644 --- a/src/Symfony/Component/Finder/Tests/FinderTest.php +++ b/src/Symfony/Component/Finder/Tests/FinderTest.php @@ -50,15 +50,40 @@ public function testFiles() public function testRemoveTrailingSlash() { - if ('\\' === \DIRECTORY_SEPARATOR) { - $this->markTestSkipped('This test cannot be run on Windows.'); + $finder = $this->buildFinder(); + + $expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')); + $in = self::$tmpDir.'//'; + + $this->assertIterator($expected, $finder->in($in)->files()->getIterator()); + } + + public function testSymlinksNotResolved() + { + if ('\\' === DIRECTORY_SEPARATOR) { + $this->markTestSkipped('symlinks are not supported on Windows'); } $finder = $this->buildFinder(); - $expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')); - $in = '//'.realpath(self::$tmpDir).'//'; + symlink($this->toAbsolute('foo'), $this->toAbsolute('baz')); + $expected = $this->toAbsolute(array('baz/bar.tmp')); + $in = self::$tmpDir.'/baz/'; + try { + $this->assertIterator($expected, $finder->in($in)->files()->getIterator()); + unlink($this->toAbsolute('baz')); + } catch (\Exception $e) { + unlink($this->toAbsolute('baz')); + throw $e; + } + } + + public function testBackPathNotNormalized() + { + $finder = $this->buildFinder(); + $expected = $this->toAbsolute(array('foo/../foo/bar.tmp')); + $in = self::$tmpDir.'/foo/../foo/'; $this->assertIterator($expected, $finder->in($in)->files()->getIterator()); } @@ -279,7 +304,7 @@ public function testInWithNonExistentDirectory() public function testInWithGlob() { $finder = $this->buildFinder(); - $finder->in(array(__DIR__.'/Fixtures/*/B/C', __DIR__.'/Fixtures/*/*/B/C'))->getIterator(); + $finder->in(array(__DIR__.'/Fixtures/*/B/C/', __DIR__.'/Fixtures/*/*/B/C/'))->getIterator(); $this->assertIterator($this->toAbsoluteFixtures(array('A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy')), $finder); } @@ -518,8 +543,8 @@ public function testMultipleLocationsWithSubDirectories() $finder->in($locations)->depth('< 10')->name('*.neon'); $expected = array( - __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon', - __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon', + __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon', + __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon', ); $this->assertIterator($expected, $finder); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php index 3c805086afec2..fdf810bebd3db 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php @@ -31,7 +31,7 @@ public function testSubPath($baseDir, array $paths, array $subPaths, array $subP public function getSubPathData() { - $tmpDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.'symfony_finder'; + $tmpDir = sys_get_temp_dir().'/symfony_finder'; return array( array( From 34bb83db0aa009eb9fececeb061755f8f8772645 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 4 Apr 2018 07:04:48 +0200 Subject: [PATCH 09/18] fixed tests --- src/Symfony/Component/Finder/Tests/BsdFinderTest.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Finder/Tests/BsdFinderTest.php b/src/Symfony/Component/Finder/Tests/BsdFinderTest.php index a7d800616625f..9ee08538735c8 100644 --- a/src/Symfony/Component/Finder/Tests/BsdFinderTest.php +++ b/src/Symfony/Component/Finder/Tests/BsdFinderTest.php @@ -19,7 +19,17 @@ */ class BsdFinderTest extends FinderTest { - protected function buildFinder() + public function testSymlinksNotResolved() + { + $this->markTestSkipped('not supported on BSD finder'); + } + + public function testBackPathNotNormalized() + { + $this->markTestSkipped('not supported on BSD finder'); + } + + protected function buildFinder() { $adapter = new BsdFindAdapter(); From 540ea112b59c4ed2fd02a263ce77a35afdcf1b52 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 4 Apr 2018 08:34:32 +0200 Subject: [PATCH 10/18] [Finder] fix tests --- src/Symfony/Component/Finder/Tests/BsdFinderTest.php | 10 ++++++++++ src/Symfony/Component/Finder/Tests/GnuFinderTest.php | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/Symfony/Component/Finder/Tests/BsdFinderTest.php b/src/Symfony/Component/Finder/Tests/BsdFinderTest.php index 42691a4318531..101175253a7ca 100644 --- a/src/Symfony/Component/Finder/Tests/BsdFinderTest.php +++ b/src/Symfony/Component/Finder/Tests/BsdFinderTest.php @@ -15,6 +15,16 @@ class BsdFinderTest extends FinderTest { + public function testSymlinksNotResolved() + { + $this->markTestSkipped('Symlinks are always resolved using the BsdFinderAdapter.'); + } + + public function testBackPathNotNormalized() + { + $this->markTestSkipped('Paths are always normalized using the BsdFinderAdapter.'); + } + protected function getAdapter() { $adapter = new BsdFindAdapter(); diff --git a/src/Symfony/Component/Finder/Tests/GnuFinderTest.php b/src/Symfony/Component/Finder/Tests/GnuFinderTest.php index 5c66723c1bea1..48286d5a2d36a 100644 --- a/src/Symfony/Component/Finder/Tests/GnuFinderTest.php +++ b/src/Symfony/Component/Finder/Tests/GnuFinderTest.php @@ -15,6 +15,16 @@ class GnuFinderTest extends FinderTest { + public function testSymlinksNotResolved() + { + $this->markTestSkipped('Symlinks are always resolved using the GnuFinderAdapter.'); + } + + public function testBackPathNotNormalized() + { + $this->markTestSkipped('Paths are always normalized using the GnuFinderAdapter.'); + } + protected function getAdapter() { $adapter = new GnuFindAdapter(); From 1b26aac8d255b2a449e3874ce5ffe28a36c12689 Mon Sep 17 00:00:00 2001 From: Boris Vujicic Date: Tue, 3 Apr 2018 16:02:27 +0200 Subject: [PATCH 11/18] [SecurityBundle] Add missing argument to security.authentication.provider.simple --- .../Security/Factory/SimplePreAuthenticationFactory.php | 1 + .../SecurityBundle/Resources/config/security_listeners.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php index 27d8c5f050ec5..c1c6e48083856 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php @@ -49,6 +49,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider, ->replaceArgument(0, new Reference($config['authenticator'])) ->replaceArgument(1, new Reference($userProvider)) ->replaceArgument(2, $id) + ->replaceArgument(3, new Reference('security.user_checker.'.$id)) ; // listener diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml index 4f3515c3ac3b2..f7462045724b3 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml @@ -236,6 +236,7 @@ + null From c82c2f1efac482a7625f87feb9ab641892184c9d Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Wed, 4 Apr 2018 11:05:00 +0200 Subject: [PATCH 12/18] [SecurityBundle] Add test for simple authentication config --- .../DependencyInjection/CompleteConfigurationTest.php | 7 +++++++ .../Tests/DependencyInjection/Fixtures/php/container1.php | 5 +++++ .../Tests/DependencyInjection/Fixtures/xml/container1.xml | 5 +++++ .../Tests/DependencyInjection/Fixtures/yml/container1.yml | 5 +++++ 4 files changed, 22 insertions(+) diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php index 0c4c78a1383fe..5a504dd2eaf01 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php @@ -101,6 +101,13 @@ public function testFirewalls() 'security.authentication.listener.anonymous.with_user_checker', 'security.access_listener', ), + array( + 'security.channel_listener', + 'security.context_listener.2', + 'security.authentication.listener.simple_form.simple_auth', + 'security.authentication.listener.anonymous.simple_auth', + 'security.access_listener', + ), ), $listeners); } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php index fc9b07c4f18b2..54ac7b20c47f5 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php @@ -86,6 +86,11 @@ 'anonymous' => true, 'http_basic' => true, ), + 'simple_auth' => array( + 'provider' => 'default', + 'anonymous' => true, + 'simple_form' => array('authenticator' => 'simple_authenticator'), + ), ), 'access_control' => array( diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml index 19167551025e2..1e48c428000ec 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml @@ -71,6 +71,11 @@ app.user_checker + + + + + ROLE_USER ROLE_USER,ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH ROLE_USER,ROLE_ADMIN diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml index e8ed61ef031b9..46dd08f8ce948 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml @@ -70,6 +70,11 @@ security: http_basic: ~ user_checker: app.user_checker + simple_auth: + provider: default + anonymous: ~ + simple_form: { authenticator: simple_authenticator } + role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] From c318306b446c64c7fa5b9097129b3cdb1355e0c5 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Wed, 4 Apr 2018 09:58:50 +0200 Subject: [PATCH 13/18] [Security] Load the user before pre/post auth checks when needed --- .../Provider/SimpleAuthenticationProvider.php | 21 ++++++++ .../SimpleAuthenticationProviderTest.php | 49 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/SimpleAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/SimpleAuthenticationProvider.php index a82fb7eea4279..ded0e94f50f6c 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/SimpleAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/SimpleAuthenticationProvider.php @@ -11,8 +11,11 @@ namespace Symfony\Component\Security\Core\Authentication\Provider; +use Symfony\Component\Security\Core\Exception\AuthenticationServiceException; +use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\User\UserChecker; use Symfony\Component\Security\Core\User\UserCheckerInterface; +use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface; @@ -45,6 +48,24 @@ public function authenticate(TokenInterface $token) } $user = $authToken->getUser(); + + if (!$user instanceof UserInterface) { + try { + $user = $this->userProvider->loadUserByUsername($user); + + if (!$user instanceof UserInterface) { + throw new AuthenticationServiceException('The user provider must return a UserInterface object.'); + } + } catch (UsernameNotFoundException $e) { + $e->setUsername($user); + throw $e; + } catch (\Exception $e) { + $e = new AuthenticationServiceException($e->getMessage(), 0, $e); + $e->setToken($token); + throw $e; + } + } + $this->userChecker->checkPreAuth($user); $this->userChecker->checkPostAuth($user); diff --git a/src/Symfony/Component/Security/Core/Tests/Authentication/Provider/SimpleAuthenticationProviderTest.php b/src/Symfony/Component/Security/Core/Tests/Authentication/Provider/SimpleAuthenticationProviderTest.php index 1e7069c1fa0bb..acee33b856b42 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authentication/Provider/SimpleAuthenticationProviderTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authentication/Provider/SimpleAuthenticationProviderTest.php @@ -15,6 +15,7 @@ use Symfony\Component\Security\Core\Exception\DisabledException; use Symfony\Component\Security\Core\Authentication\Provider\SimpleAuthenticationProvider; use Symfony\Component\Security\Core\Exception\LockedException; +use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; class SimpleAuthenticationProviderTest extends TestCase { @@ -72,6 +73,54 @@ public function testAuthenticateWhenPostChecksFails() $provider->authenticate($token); } + public function testAuthenticateFromString() + { + $user = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock(); + + $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); + $token->expects($this->any()) + ->method('getUser') + ->will($this->returnValue('foo')); + + $authenticator = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface')->getMock(); + $authenticator->expects($this->once()) + ->method('authenticateToken') + ->will($this->returnValue($token)); + + $userProvider = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserProviderInterface')->getMock(); + $userProvider->expects($this->once()) + ->method('loadUserByUsername') + ->willReturn($this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock()); + $provider = $this->getProvider($authenticator, $userProvider); + + $this->assertSame($token, $provider->authenticate($token)); + } + + /** + * @expectedException \Symfony\Component\Security\Core\Exception\UsernameNotFoundException + */ + public function testUsernameNotFound() + { + $user = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock(); + + $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); + $token->expects($this->any()) + ->method('getUser') + ->will($this->returnValue('foo')); + + $authenticator = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface')->getMock(); + $authenticator->expects($this->once()) + ->method('authenticateToken') + ->will($this->returnValue($token)); + + $userProvider = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserProviderInterface')->getMock(); + $userProvider->expects($this->once()) + ->method('loadUserByUsername') + ->willThrowException(new UsernameNotFoundException()); + + $this->getProvider($authenticator, $userProvider)->authenticate($token); + } + protected function getProvider($simpleAuthenticator = null, $userProvider = null, $userChecker = null, $key = 'test') { if (null === $userChecker) { From c0a051d46dac50f30b7b707d8faf5352db3c1253 Mon Sep 17 00:00:00 2001 From: Zan Baldwin Date: Wed, 4 Apr 2018 16:36:22 +0100 Subject: [PATCH 14/18] Fix Typo in Guard Factory --- .../Security/Factory/GuardAuthenticationFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php index 9ff906ad91ba7..533560d6d986d 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php @@ -116,7 +116,7 @@ private function determineEntryPoint($defaultEntryPointId, array $config) // we have multiple entry points - we must ask them to configure one throw new \LogicException(sprintf( - 'Because you have multiple guard configurators, you need to set the "guard.entry_point" key to one of you configurators (%s)', + 'Because you have multiple guard configurators, you need to set the "guard.entry_point" key to one of your configurators (%s)', implode(', ', $authenticatorIds) )); } From d0ea26bd15548b2cd4ae2f3fa46a178dc9f63a52 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Tue, 3 Apr 2018 20:52:56 +0200 Subject: [PATCH 15/18] Update da translations --- .../Resources/translations/validators.da.xlf | 4 +- .../Resources/translations/security.da.xlf | 4 +- .../Resources/translations/security.da.xlf | 4 +- .../Resources/translations/validators.da.xlf | 50 +++++++++---------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/Symfony/Component/Form/Resources/translations/validators.da.xlf b/src/Symfony/Component/Form/Resources/translations/validators.da.xlf index c2dd4601f9089..f52f4e0a30db9 100644 --- a/src/Symfony/Component/Form/Resources/translations/validators.da.xlf +++ b/src/Symfony/Component/Form/Resources/translations/validators.da.xlf @@ -8,11 +8,11 @@ The uploaded file was too large. Please try to upload a smaller file. - Den oploadede fil var for stor. Opload venligst en mindre fil. + Den uploadede fil var for stor. Upload venligst en mindre fil. The CSRF token is invalid. Please try to resubmit the form. - CSRF nøglen er ugyldig. + CSRF-token er ugyldig. diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.da.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.da.xlf index 2ac41502d2c7f..a62a5eb75b084 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.da.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.da.xlf @@ -24,11 +24,11 @@ Not privileged to request the resource. - Ingen tilladselese at anvende kilden. + Ingen adgang til at forespørge ressourcen. Invalid CSRF token. - Ugyldigt CSRF token. + Ugyldig CSRF-token. Digest nonce has expired. diff --git a/src/Symfony/Component/Security/Resources/translations/security.da.xlf b/src/Symfony/Component/Security/Resources/translations/security.da.xlf index 2ac41502d2c7f..a62a5eb75b084 100644 --- a/src/Symfony/Component/Security/Resources/translations/security.da.xlf +++ b/src/Symfony/Component/Security/Resources/translations/security.da.xlf @@ -24,11 +24,11 @@ Not privileged to request the resource. - Ingen tilladselese at anvende kilden. + Ingen adgang til at forespørge ressourcen. Invalid CSRF token. - Ugyldigt CSRF token. + Ugyldig CSRF-token. Digest nonce has expired. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf index 14e479a59ad07..1630b50b45af3 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf @@ -20,19 +20,19 @@ The value you selected is not a valid choice. - Værdien skal være en af de givne muligheder. + Den valgte værdi er ikke gyldig. You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - Du skal vælge mindst {{ limit }} muligheder. + Du skal vælge mindst én mulighed.|Du skal vælge mindst {{ limit }} muligheder. You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - Du kan højest vælge {{ limit }} muligheder. + Du kan højst vælge én mulighed.|Du kan højst vælge {{ limit }} muligheder. One or more of the given values is invalid. - En eller flere af de oplyste værdier er ugyldige. + En eller flere af de angivne værdier er ugyldige. This field was not expected. @@ -40,7 +40,7 @@ This field is missing. - Dette felt er mangler. + Dette felt mangler. This value is not a valid date. @@ -48,11 +48,11 @@ This value is not a valid datetime. - Værdien er ikke en gyldig dato og tid. + Værdien er ikke et gyldigt tidspunkt. This value is not a valid email address. - Værdien er ikke en gyldig e-mail adresse. + Værdien er ikke en gyldig e-mailadresse. The file could not be found. @@ -64,11 +64,11 @@ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Filen er for stor ({{ size }} {{ suffix }}). Tilladte maksimale størrelse {{ limit }} {{ suffix }}. + Filen er for stor ({{ size }} {{ suffix }}). Maksimale tilladte størrelse er {{ limit }} {{ suffix }}. The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Mimetypen af filen er ugyldig ({{ type }}). Tilladte mimetyper er {{ types }}. + Filens MIME-type er ugyldig ({{ type }}). Tilladte MIME-typer er {{ types }}. This value should be {{ limit }} or less. @@ -76,7 +76,7 @@ This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Værdien er for lang. Den skal have {{ limit }} bogstaver eller mindre. + Værdien er for lang. Den må højst indeholde {{ limit }} tegn. This value should be {{ limit }} or more. @@ -84,7 +84,7 @@ This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Værdien er for kort. Den skal have {{ limit }} tegn eller flere. + Værdien er for kort. Den skal indeholde mindst {{ limit }} tegn. This value should not be blank. @@ -104,7 +104,7 @@ This value is not a valid time. - Værdien er ikke en gyldig tid. + Værdien er ikke et gyldigt klokkeslæt. This value is not a valid URL. @@ -136,7 +136,7 @@ This is not a valid IP address. - Dette er ikke en gyldig IP adresse. + Dette er ikke en gyldig IP-adresse. This value is not a valid language. @@ -160,31 +160,31 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Billedbredden er for stor ({{ width }}px). Tilladt maksimumsbredde er {{ max_width }}px. + Billedet er for bredt ({{ width }}px). Største tilladte bredde er {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Billedebredden er for lille ({{ width }}px). Forventet minimumshøjde er {{ min_width }}px. + Billedet er for smalt ({{ width }}px). Mindste forventede bredde er {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Billedhøjden er for stor ({{ height }}px). Tilladt maksimumshøjde er {{ max_height }}px. + Billedet er for højt ({{ height }}px). Største tilladte højde er {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Billedhøjden er for lille ({{ height }}px). Forventet minimumshøjde er {{ min_height }}px. + Billedet er for lavt ({{ height }}px). Mindste forventede højde er {{ min_height }}px. This value should be the user's current password. - Værdien skal være brugerens nuværende password. + Værdien skal være brugerens nuværende adgangskode. This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Værdien skal have præcis {{ limit }} tegn. + Værdien skal være på præcis {{ limit }} tegn. The file was only partially uploaded. - Filen var kun delvis uploadet. + Filen blev kun delvist uploadet. No file was uploaded. @@ -200,19 +200,19 @@ A PHP extension caused the upload to fail. - En PHP udvidelse forårsagede fejl i upload. + En PHP-udvidelse forårsagede fejl i upload. This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Denne samling skal indeholde {{ limit }} element eller flere.|Denne samling skal indeholde {{ limit }} elementer eller flere. + Denne samling skal indeholde mindst ét element.|Denne samling skal indeholde mindst {{ limit }} elementer. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Denne samling skal indeholde {{ limit }} element eller mindre.|Denne samling skal indeholde {{ limit }} elementer eller mindre. + Denne samling skal indeholde højst ét element.|Denne samling skal indeholde højst {{ limit }} elementer. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Denne samling skal indeholde præcis {{ limit }} element.|Denne samling skal indeholde præcis {{ limit }} elementer. + Denne samling skal indeholde præcis ét element.|Denne samling skal indeholde præcis {{ limit }} elementer. Invalid card number. @@ -224,7 +224,7 @@ This is not a valid International Bank Account Number (IBAN). - Det er ikke en gyldig International Bank Account Number (IBAN). + Det er ikke et gyldigt International Bank Account Number (IBAN). This value is not a valid ISBN-10. From 24c460afa6499f5a5a800c5ed34468d3f574f7af Mon Sep 17 00:00:00 2001 From: Peter Orosz Date: Thu, 5 Apr 2018 16:08:40 +0200 Subject: [PATCH 16/18] [EventDispatcher] Dispatcher in stopEventPropagation test now registers correct listener --- .../EventDispatcher/Tests/AbstractEventDispatcherTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php index e5e9c2be83b43..5c82435d58a06 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php @@ -154,7 +154,7 @@ public function testStopEventPropagation() // be executed // Manually set priority to enforce $this->listener to be called first $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'), 10); - $this->dispatcher->addListener('post.foo', array($otherListener, 'preFoo')); + $this->dispatcher->addListener('post.foo', array($otherListener, 'postFoo')); $this->dispatcher->dispatch(self::postFoo); $this->assertTrue($this->listener->postFooInvoked); $this->assertFalse($otherListener->postFooInvoked); From fa3f105f61d7068592d40cd2217397a20d81b745 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 6 Apr 2018 16:51:52 +0200 Subject: [PATCH 17/18] updated CHANGELOG for 2.8.38 --- CHANGELOG-2.8.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG-2.8.md b/CHANGELOG-2.8.md index e933be2021abd..e53256bdc8327 100644 --- a/CHANGELOG-2.8.md +++ b/CHANGELOG-2.8.md @@ -7,6 +7,14 @@ 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.38 (2018-04-06) + + * bug #26788 [Security] Load the user before pre/post auth checks when needed (chalasr) + * bug #26774 [SecurityBundle] Add missing argument to security.authentication.provider.simple (i3or1s, chalasr) + * bug #26763 [Finder] Remove duplicate slashes in filenames (helhum) + * bug #26749 Add PHPDbg support to HTTP components (hkdobrev) + * bug #26609 [Console] Fix check of color support on Windows (mlocati) + * 2.8.37 (2018-04-02) * bug #26727 [HttpCache] Unlink tmp file on error (Chansig) From 47b29834cb08e20c4618eab9973a5e03d13a8814 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 6 Apr 2018 16:52:08 +0200 Subject: [PATCH 18/18] updated VERSION for 2.8.38 --- 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 defbf43974e42..3d54fdffcfa19 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.38-DEV'; + const VERSION = '2.8.38'; const VERSION_ID = 20838; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; const RELEASE_VERSION = 38; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019';