From 6656a18ee248752ce741f07fd707a2cc26bf408c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 08:49:57 +0100 Subject: [PATCH 01/12] updated CHANGELOG for 2.0.20 --- CHANGELOG-2.0.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG-2.0.md b/CHANGELOG-2.0.md index d771d46440..bd45eb9c1d 100644 --- a/CHANGELOG-2.0.md +++ b/CHANGELOG-2.0.md @@ -7,6 +7,18 @@ in 2.0 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.0.0...v2.0.1 +* 2.0.20 (2012-12-20) + + * 532cc9a: [FrameworkBundle] added support for URIs as an argument to HttpKernel::render() + * 1f8c501: [FrameworkBundle] restricted the type of controllers that can be executed by InternalController + * 8b2c17f: fix double-decoding in the routing system + * 773d818: [FrameworkBundle] Added a check on file mime type for CodeHelper::fileExcerpt() + * a0e2391: [FrameworkBundle] used the new method for trusted proxies + * 8bb3208: [Config] Loader::import must return imported data + * 447ff91: [HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible + * 0489799: [HttpFoundation] added a check for the host header value + * ae3d531: [TwigBundle] Moved the registration of the app global to the environment + * 2.0.19 (2012-11-29) * e5536f0: replaced magic strings by proper constants From b967e04ccc5829581f1e46b1a7c1fba8c6d4b3d0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 08:50:28 +0100 Subject: [PATCH 02/12] update CONTRIBUTORS for 2.0.20 --- CONTRIBUTORS.md | 163 ++++++++++++++++++++++++++---------------------- 1 file changed, 90 insertions(+), 73 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e243a48917..92fb61f188 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -12,8 +12,8 @@ Symfony2 is the result of the work of many people who made the code better - Kris Wallsmith (kriswallsmith) - Christophe Coevoet (stof) - Tobias Schultze (tobion) - - Karma Dordrak (drak) - Pascal Borreli (pborreli) + - Karma Dordrak (drak) - Ryan Weaver - Lukas Kahwe Smith (lsmith) - Jeremy Mikola (jmikola) @@ -22,146 +22,159 @@ Symfony2 is the result of the work of many people who made the code better - Joseph Bielawski (stloyd) - Eriksen Costa (eriksencosta) - Hugo Hamon (hhamon) - - Jonathan Wage (jwage) - Martin Hasoň (hason) + - Jonathan Wage (jwage) - William Durand (couac) - Alexandre Salomé (alexandresalome) - ornicar - stealth35 ‏ (stealth35) - - Bulat Shakirzyanov (avalanche123) - Jean-François Simon (jfsimon) + - Bulat Shakirzyanov (avalanche123) - Francis Besset (francisbesset) - Miha Vrhovnik - Henrik Bjørnskov (henrikbjorn) - Konstantin Kudryashov (everzet) - Jakub Zalas (jakubzalas) + - Arnaud Le Blanc (arnaud-lb) - Eric Clemmons (ericclemmons) - Henrik Westphal (snc) - - Deni - - Dariusz Górecki (canni) - Alexander Mols (asm89) - - Arnout Boks (aboks) - - Hidenori Goto (hidenorigoto) - - Jordan Alliot (jalliot) + - Deni + - Romain Neutron (romain) + - Dariusz Górecki (canni) - Marc Weistroff (futurecat) - - Brandon Turner + - Jordan Alliot (jalliot) + - Arnout Boks (aboks) - Саша Стаменковић (umpirsky) + - Hidenori Goto (hidenorigoto) + - Brandon Turner - Andrej Hudec (pulzarraider) - Brikou Carré (brikou) - John Wards (johnwards) - Antoine Hérault (herzult) - Daniel Holmes (dholmes) - - Arnaud Le Blanc (arnaud-lb) + - Bilal Amarni (bamarni) - Christian Raue + - Tim Nagel (merk) + - Michal Piotrowski (eventhorizon) + - Włodzimierz Gajda (gajdaw) + - Florin Patan (florinpatan) - lenar - Fabien Pennequin (fabienpennequin) - - Tim Nagel (merk) - - Włodzimierz Gajda (gajdaw) - - excelwebzone - - Bilal Amarni (bamarni) - - Romain Neutron (romain) - Bart van den Burg (burgov) + - excelwebzone - Kevin Bond (kbond) - - Florin Patan (florinpatan) + - Richard Miller (mr_r_miller) + - Grégoire Pineau (lyrixx) - Toni Uebernickel (havvg) - Jacob Dreesen (jdreesen) - Douglas Greenshields (shieldo) - - Richard Miller (mr_r_miller) - - Grégoire Pineau (lyrixx) - Richard Shank (iampersistent) - Sebastian Hörl (blogsh) - - Michal Piotrowski (eventhorizon) + - Mario A. Alvarez Garcia (nomack84) - Juti Noppornpitak - Robert Schönthal (digitalkaoz) - Michał Pipa (michal.pipa) + - woodspire - Daniel Gomes (danielcsgomes) - Michel Weimerskirch (mweimerskirch) - Tigran Azatyan (tigranazatyan) - Pierre Minnieur (pminnieur) + - Arnaud Kleinpeter (nanocom) + - Jonathan Ingram (jonathaningram) - Javier Eguiluz (javier.eguiluz) - Matthieu Ouellette-Vachon (maoueh) + - Larry Garfield (crell) - Amal Raghav (kertz) - - Jonathan Ingram (jonathaningram) - Artur Kotyrba - Pablo Godel (pgodel) - Helmer Aaviksoo - Clément JOBEILI (dator) - Julien Brochet (mewt) - - Arnaud Kleinpeter (nanocom) + - David Buchmann (dbu) + - Sebastiaan Stok (sstok) - Benjamin Dulau (dbenjamin) + - Felix Labrecque - Andreas Hucks (meandmymonkey) - Noel Guilbert (noel) - Jérémie Augustin (jaugustin) - Martin Schuhfuß (usefulthink) - Thomas Rabaix (rande) - Dennis Benkert (denderello) + - Marcel Beerta (mazen) - Rafael Dohms (rdohms) - Matthieu Bontemps (mbontemps) - fivestar - Dominique Bongiraud - Leszek Prabucki (l3l0) + - Danny Berger (dpb587) - Dustin Whittle (dustinwhittle) + - Fran Moreno (franmomu) - jeff - Justin Hileman (bobthecow) - Sven Paulus (subsven) - Xavier Perez - Rui Marinho (ruimarinho) - - Larry Garfield (crell) - - David Buchmann (dbu) + - Ray - Joseph Rouff (rouffj) - - Marcel Beerta (mazen) + - Albert Casademont (acasademont) - Gordon Franke (gimler) - Francois Zaninotto - François Zaninotto (fzaninotto) - - Danny Berger (dpb587) - Xavier Montaña Carreras (xmontana) - Gábor Egyed (1ed) - Katsuhiro OGAWA - Clemens Tolboom - Alif Rachmawadi + - boombatower + - Florian Klein (docteurklein) - jules boussekeyt (gordonslondon) - Jan Sorgalla (jsor) - - Ray - Lee McDermott - - Mario A. Alvarez Garcia (nomack84) - Guilherme Blanco (guilhermeblanco) - jdhoek - geoffrey - Wodor Wodorski - Matthew Lewinski (lewinski) - Kim Hemsø Rasmussen + - Dirk Pahl (dirkaholic) - Wouter Van Hecke - Gyula Sallai (salla) - Michael Holm (hollo) - Peter Kokot (maastermedia) - arjen - - Florian Klein (docteurklein) - Adrien Brault (adrienbrault) - Manuel Kiessling (manuelkiessling) - Sergey Linnik - Bertrand Zuchuat (garfield-fr) + - Beau Simensen (simensen) - Grégoire Paris (greg0ire) + - Tamas Szijarto - Grégoire Passault (gregwar) - Aurelijus Valeiša (aurelijus) - Gustavo Piltcher - - Albert Casademont (acasademont) + - Stepan Tanasiychuk (stfalcon) - Albert Jessurum (ajessu) - Tiago Ribeiro (fixe) - Adrian Rudnik (kreischweide) - Francesc Rosàs (frosas) + - Julien Galenski (ruian) - Bongiraud Dominique - Michel Salib (michelsalib) + - Jeanmonod David (jeanmonod) + - Thomas Lallement (raziel057) + - Niklas Fiekas - Brouznouf - Andréia Bohner (andreia) - - Sebastiaan Stok (sstok) - Sebastian Bergmann - - Fran Moreno (franmomu) - Greg Thornton (xdissent) + - sun (sun) + - Yaroslav Kiliba - Lars Strojny - - Beau Simensen (simensen) + - Terje Bråten - Costin Bereveanu (schniper) + - Markus Lanthaler (lanthaler) - realmfoo - - Tamas Szijarto - Tobias Naumann - Shein Alexey - Joe Lencioni @@ -172,23 +185,19 @@ Symfony2 is the result of the work of many people who made the code better - hubert lecorche (hlecorche) - Oscar Cubo Medina (ocubom) - Christophe L. (christophelau) - - Julien Galenski (ruian) - Michael Ridgway - - Stepan Tanasiychuk (stfalcon) - Pavel Campr (pcampr) - Brian King - - Jeanmonod David (jeanmonod) - Jan Schumann - - Niklas Fiekas - Olivier Dolbeau (odolbeau) - Michele Orselli (orso) - Asier Illarramendi (doup) - Christoph Mewes (xrstf) - - Dirk Pahl (dirkaholic) + - Jonas Flodén (flojon) - Shigenibu Nishikawa - Marcin Sikoń (marphi) - Miquel Rodríguez Telep (mrtorrent) - - boombatower + - Filippo Tessarotto - Laurent Bachelier (laurentb) - Fabian Lange (codingfabian) - Yoshio HANAWA @@ -196,12 +205,12 @@ Symfony2 is the result of the work of many people who made the code better - Pablo Díez (pablodip) - Michael Piecko (michael.piecko) - Manuel de Ruiter (manuel) - - sun (sun) - ondrowan + - Roman Marintsenko (inori) - mcben - - Markus Lanthaler (lanthaler) - - Yaroslav Kiliba + - Jérôme Vieilledent (lolautruche) - Peter Kruithof (pkruithof) + - Eric GELOEN (gelo) - Erik Trapman (eriktrapman) - De Cock Xavier (xdecock) - Manuel Reinhard (sprain) @@ -224,19 +233,33 @@ Symfony2 is the result of the work of many people who made the code better - Zach Badgett (zachbadgett) - Aurélien Fredouelle - Francesco Levorato + - Thomas Tourlourat (armetiz) - Geoffrey Tran (geoff) + - Florian Rey (nervo) - Christian Schaefer (caefer) - Elliot Anderson (elliot) - - Thomas Lallement (raziel057) + - Patrick Kaufmann + - Ben Ramsey (ramsey) + - Christian Jul Jensen + - Chris Jones (leek) - Markus Bachmann (baachi) + - Colin Frei - aubx - Max Rath (drak3) + - DerManoMann - Nahuel Cuesta (ncuesta) - Chris Boden (cboden) + - Roumen Damianoff (roumen) + - Jeremy David (jeremy.david) + - Konstantin Myakshin (koc) - Dustin Dobervich (dustin10) - Sebastian Marek (proofek) - Erkhembayar Gantulga (erheme318) + - Ken Marfilla (marfillaster) - Rostyslav Kinash + - jfcixmedia + - Vincent Simonin + - Chris Heng - yktd26 - Tom Van Looy (tvlooy) - umpirski @@ -244,23 +267,27 @@ Symfony2 is the result of the work of many people who made the code better - John Kary (johnkary) - Hossein Bukhamsin - Fabrice Bernhard (fabriceb) + - Mark Sonnabaum - develop - - Filippo Tessarotto - hossein zolfi (ocean) - Atsuhiro KUBO (iteman) + - Samy Dindane (dinduks) - yclian - Jérémy Romey (jeremyfreeagent) + - Matt Daum (daum) - Hiromi Hishida (77web) - Yuen-Chi Lian - Joshua Nye + - Sebastian Krebs - avorobiev - Mark Challoner - Andrew Tchircoff (andrewtch) + - BilgeXA - michaelwilliams - Casper Valdemar Poulsen - Josiah (josiah) - John Bohn (jbohn) - - Roman Marintsenko (inori) + - Nicolas Schwartz (nicoschwartz) - Degory Valentine - Krzysiek Łabuś - Xavier Lacot (xavier) @@ -273,31 +300,37 @@ Symfony2 is the result of the work of many people who made the code better - Jan Prieser - James Michael DuPont - Tom Klingenberg + - Gunther Konig - Christopher Hall (mythmakr) - Paul Kamer (pkamer) - Pierre Vanliefland (pvanliefland) - - Eric GELOEN (gelo) - Philipp Kräutli (pkraeutli) - frost-nzcr4 + - Loïc Chardonnet (gnusat) - Michaël Perrin (michael.perrin) - Abhoryo - Fabian Vogler (fabian) + - Leevi Graham - Maksim Kotlyar (makasim) - Neil Ferreira - Tony Malzhacker - Cyril Quintin (cyqui) - Gerard van Helden (drm) - Johnny Peck (johnnypeck) + - Denis Gorbachev (starfall) - Kirill chEbba Chebunin - Benjamin Leveque (benji07) - Gustavo Falco (gfalco) - Matt Robinson (inanimatt) - julien pauli (jpauli) - mwsaz + - Benoît Bourgeois + - Filipe Guerra - corphi - grizlik - Derek ROTH - Shin Ohno (ganchiku) + - Jan Kramer (jankramer) - Drew Butler (nodrew) - Don Pinkster - Emil Einarsson @@ -308,35 +341,32 @@ Symfony2 is the result of the work of many people who made the code better - Arno Geurts - Adán Lobato (adanlobato) - Mikhail Yurasov + - jamogon + - Sam Williams - Miha Vrhovnik + - Moritz Borgmann - Daniel Cestari - - Thomas Tourlourat (armetiz) + - Eugene Leonovich - Karoly Negyesi (chx) - Javier López (loalf) - Magnus Nordlander (magnusnordlander) - Adam Monsen (meonkeys) - - Florian Rey (nervo) - LOUARDI Abdeltif (ouardisoft) - Robert Gruendler (pulse00) + - ragtek (ragtek) - Benoît Merlet (trompette) - Maks - Jan Behrens - Raul Fraile (raulfraile) - sensio - - Patrick Kaufmann - Théophile Helleboid - chtitux - - Ben Ramsey (ramsey) - - Christian Jul Jensen - - Chris Jones (leek) - xaav - Juti Noppornpitak - - Roumen Damianoff - Sander Coolen - Josip Kruslin - Anton Babenko (antonbabenko) - Irmantas Šiupšinskas (irmantas) - Tero Alén (tero) - - DerManoMann - Vadim Tyukov (vatson) - Sortex - arjenjb @@ -347,13 +377,9 @@ Symfony2 is the result of the work of many people who made the code better - julien.galenski - Sébastien Lavoie - Per Sandström (per) - - Jeremy David (jeremy.david) - - Ken Marfilla (marfillaster) - Robert Kiss (kepten) - - jfcixmedia - Vitaliy Tverdokhlib (vitaliytv) - Martijn Evers - - Chris Heng - Nerijus Arlauskas - DerManoMann - Jochen Bayer (jocl) @@ -375,18 +401,15 @@ Symfony2 is the result of the work of many people who made the code better - modi - Sergey Yuferev - Richard van den Brand (ricbra) - - Mark Sonnabaum - Aharon Perkel + - Malaney J. Hill - Andy Cox (ringo) - Balázs Benyó (duplabe) - Sebastian Utz - - Samy Dindane (dinduks) - Keri Henare (kerihenare) - Cédric Lahouste (rapotor) - - Terje Bråten - Janusz Jablonski - George Giannoulopoulos - - Matt Daum (daum) - Alberto Pirovano (geezmo) - Xavier Briand (xavierbriand) - Evan Kaufman @@ -397,18 +420,15 @@ Symfony2 is the result of the work of many people who made the code better - Stéphane PY (steph_py) - Martin Eckhardt - Michael Dowling (mtdowling) - - BilgeXA - mlively - Thomas Chmielowiec (chmielot) - Sebastian Ionescu - Simon Neidhold - Kevin Dew - James Cowgill - - Nicolas Schwartz (nicoschwartz) - Konrad Mohrfeldt - Mephistofeles - pscheit - - Jérôme Vieilledent (lolautruche) - Nicolas Badey (nico-b) - Lars Strojny - Bouke Haarsma @@ -419,6 +439,7 @@ Symfony2 is the result of the work of many people who made the code better - Paweł Wacławczyk (pwc) - Thomas Bibb - Josef Cech + - Andrey Esaulov (andremaha) - hicham ELGUAROUANI (hiiimoo) - Ivan Kurnosov - stloyd @@ -426,17 +447,16 @@ Symfony2 is the result of the work of many people who made the code better - Chris Tickner (tickner) - Luis Muñoz - Thomas Chmielowiec - - Gunther Konig - Oleg Zinchenko - Benjamin Grandfond (benjamin) - Christoph Nissle (derstoffel) - Stefano Sala (stefano.sala) + - Xavier HAUSHERR - Benjamin Zikarsky - Romain Dorgueil - Grayson Koonce (breerly) - Andy Stanberry - alefranz - - Loïc Chardonnet (gnusat) - Alessio Baglio (ioalessio) - Jérôme Macias (jeromemacias) - Cédric Dugat (ph3nol) @@ -456,7 +476,7 @@ Symfony2 is the result of the work of many people who made the code better - Dan Patrick (mdpatrick) - Pierre-Yves LEBECQ (pylebecq) - Rares Vlaseanu (raresvla) - - Denis Gorbachev (starfall) + - Tugdual Saunier (tucksaun) - Alexander Zogheb - Florian Pfitzer - Linnik Sergey @@ -475,7 +495,6 @@ Symfony2 is the result of the work of many people who made the code better - cyrillej - Grummfy - Eduardo Gulias - - Filipe Guerra - Rowan Manning - David Windell - Gabriel Birke @@ -529,7 +548,6 @@ Symfony2 is the result of the work of many people who made the code better - Kaipi Yann - Samuel Laulhau - Oleg Stepura - - Sam Williams - James Michael DuPont - Ondrej Slinták - vlechemin @@ -539,7 +557,6 @@ Symfony2 is the result of the work of many people who made the code better - djama - Sébastien HOUZE - Abdulkadir N. A. - - Moritz Borgmann - Thorsten Hallwas - Vincent - Chris Smith @@ -547,6 +564,7 @@ Symfony2 is the result of the work of many people who made the code better - David Soria Parra - Sergiy Sokolenko - Penny Leach + - Philipp Rieber - DanSync - Peter Zwosta - parhs @@ -566,7 +584,6 @@ Symfony2 is the result of the work of many people who made the code better - Daniel Londero (dlondero) - Adel ELHAIBA (eadel) - Fabien Dosse (fabd) - - Jonas Flodén (flojon) - Yohan Giarelli (frequence-web) - Massimiliano Arione (garak) - Vladislav Krupenkin (ideea) @@ -580,9 +597,9 @@ Symfony2 is the result of the work of many people who made the code better - Florent CAILHOL (ooflorent) - Petr Jaroš (petajaros) - Daniel Perez Pinazo (pitiflautico) - - ragtek (ragtek) - Ruud Kamphuis (ruudk) - Sebastian Busch (sebu) + - Simon Terrien (sterrien) - Markus Tacker (tacker) - Tyler Stroud (tystr) - Eugene Babushkin (warl) From 16c554bc1fa8ccdfeb998ed1624fb77918b53722 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 08:51:16 +0100 Subject: [PATCH 03/12] updated VERSION for 2.0.20 --- 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 6927924314..6f1329b8af 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -56,12 +56,12 @@ abstract class Kernel implements KernelInterface protected $startTime; protected $classes; - const VERSION = '2.0.20-DEV'; + const VERSION = '2.0.20'; const VERSION_ID = '20020'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '0'; const RELEASE_VERSION = '20'; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; /** * Constructor. From 0085798dffe31e3e3134f1a7f39190becd97ecd6 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 08:58:18 +0100 Subject: [PATCH 04/12] [FrameworkBundle] fixed XSD for the trusted-proxies setting --- .../FrameworkBundle/DependencyInjection/Configuration.php | 4 ++++ .../Resources/config/schema/symfony-1.0.xsd | 1 + .../Tests/DependencyInjection/ConfigurationTest.php | 2 +- .../Tests/DependencyInjection/Fixtures/php/full.php | 2 ++ .../Tests/DependencyInjection/Fixtures/xml/full.xml | 2 +- .../Tests/DependencyInjection/Fixtures/yml/full.yml | 2 ++ .../Tests/DependencyInjection/FrameworkExtensionTest.php | 8 ++++++++ 7 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index eab82121c0..668f37cb0f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -48,6 +48,10 @@ class Configuration implements ConfigurationInterface ->children() ->scalarNode('charset')->end() ->arrayNode('trusted_proxies') + ->beforeNormalization() + ->ifTrue(function($v) { return !is_array($v); }) + ->then(function($v) { return preg_split('/\s*,\s*/', $v); }) + ->end() ->prototype('scalar') ->validate() ->ifTrue(function($v) { return !filter_var($v, FILTER_VALIDATE_IP); }) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index 1ad5208612..836674af0e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -23,6 +23,7 @@ + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index d6d7cf9a14..1c5c72098f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -57,7 +57,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException Symfony\Component\Config\Definition\Exception\InvalidTypeException + * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException */ public function testInvalidTypeTrustedProxies() { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php index 995220bab9..d68b311808 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -3,6 +3,8 @@ $container->loadFromExtension('framework', array( 'secret' => 's3cr3t', 'form' => null, + 'trust_proxy_headers' => true, + 'trusted_proxies' => array('127.0.0.1', '10.0.0.1'), 'csrf_protection' => array( 'enabled' => true, 'field_name' => '_csrf', diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml index 1c025c8829..36e091215e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml index 0dd5eaf42c..e8e09f88e1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml @@ -1,6 +1,8 @@ framework: secret: s3cr3t form: ~ + trust_proxy_headers: true + trusted_proxies: ['127.0.0.1', '10.0.0.1'] csrf_protection: enabled: true field_name: _csrf diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index ba57323507..38e7234c02 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -33,6 +33,14 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertEquals('s3cr3t', $container->getParameterBag()->resolveValue($container->findDefinition('form.csrf_provider')->getArgument(1))); } + public function testProxies() + { + $container = $this->createContainerFromFile('full'); + + $this->assertTrue($container->getParameter('kernel.trust_proxy_headers')); + $this->assertEquals(array('127.0.0.1', '10.0.0.1'), $container->getParameter('kernel.trusted_proxies')); + } + public function testEsi() { $container = $this->createContainerFromFile('full'); From 4517aebe6f96dca78dfc8925b386987ed9b3fbf1 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 10:21:38 +0100 Subject: [PATCH 05/12] [FrameworkBundle] fixed trusted_proxies configuration for some edge cases --- .../FrameworkBundle/DependencyInjection/Configuration.php | 6 +++--- .../Tests/DependencyInjection/ConfigurationTest.php | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 668f37cb0f..2d1d145080 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -49,12 +49,12 @@ class Configuration implements ConfigurationInterface ->scalarNode('charset')->end() ->arrayNode('trusted_proxies') ->beforeNormalization() - ->ifTrue(function($v) { return !is_array($v); }) - ->then(function($v) { return preg_split('/\s*,\s*/', $v); }) + ->ifTrue(function($v) { return !is_array($v) && !is_null($v); }) + ->then(function($v) { return is_bool($v) ? array() : preg_split('/\s*,\s*/', $v); }) ->end() ->prototype('scalar') ->validate() - ->ifTrue(function($v) { return !filter_var($v, FILTER_VALIDATE_IP); }) + ->ifTrue(function($v) { return !empty($v) && !filter_var($v, FILTER_VALIDATE_IP); }) ->thenInvalid('Invalid proxy IP "%s"') ->end() ->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 1c5c72098f..949dc18d61 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -53,6 +53,9 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase array(array('secret' => 's3cr3t', 'trusted_proxies' => array('127.0.0.1')), array('secret' => 's3cr3t', 'trusted_proxies' => array('127.0.0.1'), 'trust_proxy_headers' => false, 'ide' => NULL, 'annotations' => array('cache' => 'file', 'file_cache_dir' => '%kernel.cache_dir%/annotations', 'debug' => false))), array(array('secret' => 's3cr3t', 'trusted_proxies' => array('::1')), array('secret' => 's3cr3t', 'trusted_proxies' => array('::1'), 'trust_proxy_headers' => false, 'ide' => NULL, 'annotations' => array('cache' => 'file', 'file_cache_dir' => '%kernel.cache_dir%/annotations', 'debug' => false))), array(array('secret' => 's3cr3t', 'trusted_proxies' => array('127.0.0.1', '::1')), array('secret' => 's3cr3t', 'trusted_proxies' => array('127.0.0.1', '::1'), 'trust_proxy_headers' => false, 'ide' => NULL, 'annotations' => array('cache' => 'file', 'file_cache_dir' => '%kernel.cache_dir%/annotations', 'debug' => false))), + array(array('secret' => 's3cr3t', 'trusted_proxies' => null), array('secret' => 's3cr3t', 'trusted_proxies' => array(), 'trust_proxy_headers' => false, 'ide' => NULL, 'annotations' => array('cache' => 'file', 'file_cache_dir' => '%kernel.cache_dir%/annotations', 'debug' => false))), + array(array('secret' => 's3cr3t', 'trusted_proxies' => false), array('secret' => 's3cr3t', 'trusted_proxies' => array(), 'trust_proxy_headers' => false, 'ide' => NULL, 'annotations' => array('cache' => 'file', 'file_cache_dir' => '%kernel.cache_dir%/annotations', 'debug' => false))), + array(array('secret' => 's3cr3t', 'trusted_proxies' => array()), array('secret' => 's3cr3t', 'trusted_proxies' => array(), 'trust_proxy_headers' => false, 'ide' => NULL, 'annotations' => array('cache' => 'file', 'file_cache_dir' => '%kernel.cache_dir%/annotations', 'debug' => false))), ); } From 369e4a645bd0ac6a9739a3419ccc1eccc9a0adb8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 15:10:17 +0100 Subject: [PATCH 06/12] bumped Symfony version to 2.0.21-DEV --- 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 6f1329b8af..d18c2e75cb 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -56,12 +56,12 @@ abstract class Kernel implements KernelInterface protected $startTime; protected $classes; - const VERSION = '2.0.20'; - const VERSION_ID = '20020'; + const VERSION = '2.0.21'; + const VERSION_ID = '20021'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '0'; - const RELEASE_VERSION = '20'; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = '21'; + const EXTRA_VERSION = 'DEV'; /** * Constructor. From e7fc97e9059f85bd53e092d7a20eaac1d58f26e0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 15:21:58 +0100 Subject: [PATCH 07/12] updated CHANGELOG for 2.1.5 --- CHANGELOG-2.1.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG-2.1.md b/CHANGELOG-2.1.md index 03074c23db..0456747229 100644 --- a/CHANGELOG-2.1.md +++ b/CHANGELOG-2.1.md @@ -7,6 +7,41 @@ in 2.1 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.1.0...v2.1.1 +* 2.1.5 (2012-12-20) + + * 532cc9a: [FrameworkBundle] added support for URIs as an argument to HttpKernel::render() + * 1f8c501: [FrameworkBundle] restricted the type of controllers that can be executed by InternalController + * 2cd43da: [Process] Allow non-blocking start with PhpProcess + * 8b2c17f: fix double-decoding in the routing system + * 098b593: [Session] Added exception to save method + * ad29df5: [Form] Fixed DateTimeToStringTransformer parsing on PHP < 5.3.8 + * 773d818: [FrameworkBundle] Added a check on file mime type for CodeHelper::fileExcerpt() + * f24e3d7: [HttpKernel] Revise MongoDbProfilerStorage::write() return value + * 78c5273: [Session] Document Mongo|MongoClient argument type instead of "object" + * de19a81: [HttpKernel] Support MongoClient and Mongo connection classes + * b28af77: [Session] Support MongoClient and Mongo connection classes + * 20e93bf: [Session] Utilize MongoDB::selectCollection() + * b20c5ca: [Form] Fixed reverse transformation of values in DateTimeToStringTransformer + * d2231d8: [Console] Add support for parsing terminal width/height on localized windows, fixes #5742 + * 03b880f: [Form] Fixed treatment of countables and traversables in Form::isEmpty() + * 21a59ca: [Form] Fixed FileType not to throw an exception when bound empty + * eac14b5: Check if key # is defined in $value + * a0e2391: [FrameworkBundle] used the new method for trusted proxies + * d6a402a: [Security] fixed path info encoding (closes #6040, closes #5695) + * 47dfb9c: [HttpFoundation] added some tests for the previous merge and removed dead code (closes #6037) + * 1ab4923: Improved Cache-Control header when no-cache is sent + * 4e909bd: Fix to allow null values in labels array + * 9e46819: Fixed: HeaderBag::parseCacheControl() not parsing quoted zero correctly + * 8bb3208: [Config] Loader::import must return imported data + * ca5d9ac: [DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed + * 6e7e08f: [Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text" + * 447ff91: [HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes #5878, closes #6185) + * 0489799: [HttpFoundation] added a check for the host header value + * b604eb7: [DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option + * 99321cb: [DoctrineBridge] Fixed: Exception is thrown if the entity class is not known to Doctrine + * 2ed30e7: Fixed DefaultValue for session.auto_start in NodeDefinition + * ae3d531: [TwigBundle] Moved the registration of the app global to the environment + * 2.1.4 (2012-11-29) * e5536f0: replaced magic strings by proper constants From 1770d3f5ede822055a468123b4563a1c3d5a2032 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 15:27:50 +0100 Subject: [PATCH 08/12] updated VERSION for 2.1.5 --- 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 8eaf8699e6..ed970725fc 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 $classes; protected $errorReportingLevel; - const VERSION = '2.1.5-DEV'; + const VERSION = '2.1.5'; const VERSION_ID = '20105'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '1'; const RELEASE_VERSION = '5'; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; /** * Constructor. From 06e1de9742eadb097b765d01788c24ce6ee5ee66 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 15:53:35 +0100 Subject: [PATCH 09/12] bumped Symfony version to 2.1.6-DEV --- 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 ed970725fc..001494fecc 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 $classes; protected $errorReportingLevel; - const VERSION = '2.1.5'; - const VERSION_ID = '20105'; + const VERSION = '2.1.6-DEV'; + const VERSION_ID = '20106'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '1'; - const RELEASE_VERSION = '5'; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = '6'; + const EXTRA_VERSION = 'DEV'; /** * Constructor. From ce536cdd5a47311fda4b6f373d04ff6c7147647e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 23:02:55 +0100 Subject: [PATCH 10/12] [FrameworkBundle] fixed ESI calls --- .../Bundle/FrameworkBundle/HttpKernel.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 722bc6f960..9f499d4743 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -116,18 +116,30 @@ class HttpKernel extends BaseHttpKernel } if ($this->esiSupport && (true === $options['standalone'] || 'esi' === $options['standalone'])) { - $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query']); + if (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://')) { + $uri = $controller; + } else { + $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query']); + } $alt = ''; if ($options['alt']) { - $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array()); + if (is_string($options['alt']) && (0 === strpos($options['alt'], 'http://') || 0 === strpos($options['alt'], 'https://'))) { + $alt = $options['alt']; + } else { + $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array()); + } } return $this->container->get('esi')->renderIncludeTag($uri, $alt, $options['ignore_errors'], $options['comment']); } if ('js' === $options['standalone']) { - $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query'], false); + if (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://')) { + $uri = $controller; + } else { + $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query'], false); + } $defaultContent = null; if ($template = $this->container->getParameter('templating.hinclude.default_template')) { From b8e5689363a5429ed75f8e166df1324ee5c42ecc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 23:13:30 +0100 Subject: [PATCH 11/12] [FrameworkBundle] fixed ESI calls --- src/Symfony/Bundle/FrameworkBundle/HttpKernel.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 2551530ce2..75f32e3f95 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -113,11 +113,19 @@ class HttpKernel extends BaseHttpKernel } if ($this->esiSupport && $options['standalone']) { - $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query']); + if (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://')) { + $uri = $controller; + } else { + $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query']); + } $alt = ''; if ($options['alt']) { - $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array()); + if (is_string($options['alt']) && (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://'))) { + $alt = $options['alt']; + } else { + $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array()); + } } return $this->container->get('esi')->renderIncludeTag($uri, $alt, $options['ignore_errors'], $options['comment']); From bc09ac9eb0231496e261a5fac2bfd6935ea9f5fe Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 23:15:41 +0100 Subject: [PATCH 12/12] fixed typo --- src/Symfony/Bundle/FrameworkBundle/HttpKernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 75f32e3f95..1b5a22c821 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -121,7 +121,7 @@ class HttpKernel extends BaseHttpKernel $alt = ''; if ($options['alt']) { - if (is_string($options['alt']) && (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://'))) { + if (is_string($options['alt']) && (0 === strpos($options['alt'], 'http://') || 0 === strpos($options['alt'], 'https://'))) { $alt = $options['alt']; } else { $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array());