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 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 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9f0725dcd7..92fb61f188 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -11,116 +11,125 @@ Symfony2 is the result of the work of many people who made the code better - Johannes S (johannes) - Kris Wallsmith (kriswallsmith) - Christophe Coevoet (stof) + - Tobias Schultze (tobion) + - Pascal Borreli (pborreli) - Karma Dordrak (drak) - Ryan Weaver - - Pascal Borreli (pborreli) - Lukas Kahwe Smith (lsmith) - - Tobias Schultze (tobion) - Jeremy Mikola (jmikola) - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - 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) + - Jean-François Simon (jfsimon) - Bulat Shakirzyanov (avalanche123) - Francis Besset (francisbesset) - Miha Vrhovnik - Henrik Bjørnskov (henrikbjorn) - Konstantin Kudryashov (everzet) - - Jean-François Simon (jfsimon) - 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) - - Daniel Holmes (dholmes) - Antoine Hérault (herzult) + - Daniel Holmes (dholmes) + - 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) - - excelwebzone - - Bilal Amarni (bamarni) - - Romain Neutron (romain) - Bart van den Burg (burgov) + - excelwebzone - Kevin Bond (kbond) - - Włodzimierz Gajda (gajdaw) - - Toni Uebernickel (havvg) - - Douglas Greenshields (shieldo) - Richard Miller (mr_r_miller) + - Grégoire Pineau (lyrixx) + - Toni Uebernickel (havvg) - Jacob Dreesen (jdreesen) + - Douglas Greenshields (shieldo) - Richard Shank (iampersistent) - Sebastian Hörl (blogsh) - - Florin Patan (florinpatan) - - Michal Piotrowski (eventhorizon) - - Grégoire Pineau (lyrixx) + - 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) - Artur Kotyrba + - Pablo Godel (pgodel) - Helmer Aaviksoo - Clément JOBEILI (dator) - Julien Brochet (mewt) - - Arnaud Kleinpeter (nanocom) - - Jonathan Ingram (jonathaningram) + - 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 - - Pablo Godel (pgodel) - - Arnaud Le Blanc (arnaud-lb) - Leszek Prabucki (l3l0) + - Danny Berger (dpb587) - Dustin Whittle (dustinwhittle) + - Fran Moreno (franmomu) - jeff - Justin Hileman (bobthecow) - Sven Paulus (subsven) - Xavier Perez - Rui Marinho (ruimarinho) + - 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 - - Larry Garfield (crell) + - boombatower + - Florian Klein (docteurklein) - jules boussekeyt (gordonslondon) - Jan Sorgalla (jsor) - - Ray - Lee McDermott - Guilherme Blanco (guilhermeblanco) - jdhoek @@ -128,40 +137,44 @@ Symfony2 is the result of the work of many people who made the code better - 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) - - David Buchmann (dbu) - 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 - - Mario A. Alvarez Garcia (nomack84) - Tobias Naumann - Shein Alexey - Joe Lencioni @@ -173,21 +186,18 @@ Symfony2 is the result of the work of many people who made the code better - Oscar Cubo Medina (ocubom) - Christophe L. (christophelau) - 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,9 +206,11 @@ Symfony2 is the result of the work of many people who made the code better - Michael Piecko (michael.piecko) - Manuel de Ruiter (manuel) - ondrowan + - Roman Marintsenko (inori) - mcben - - Yaroslav Kiliba + - Jérôme Vieilledent (lolautruche) - Peter Kruithof (pkruithof) + - Eric GELOEN (gelo) - Erik Trapman (eriktrapman) - De Cock Xavier (xdecock) - Manuel Reinhard (sprain) @@ -221,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) - - Julien Galenski (ruian) - Elliot Anderson (elliot) + - 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 @@ -241,57 +267,70 @@ 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) + - Nicolas Schwartz (nicoschwartz) - Degory Valentine - Krzysiek Łabuś - Xavier Lacot (xavier) - - Markus Lanthaler (lanthaler) - Olivier Maisonneuve - - Daniel F. Kudwien (sun) - cgonzalez + - matt foster - Evan S Kaufman (evanskaufman) - Ismael Ambrosi (iambrosi) - Jayson Xu (superjavason) - Jan Prieser - James Michael DuPont - Tom Klingenberg + - Gunther Konig - Christopher Hall (mythmakr) - Paul Kamer (pkamer) + - Pierre Vanliefland (pvanliefland) - 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 @@ -302,28 +341,27 @@ 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) @@ -339,12 +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) - - Ken Marfilla (marfillaster) - Robert Kiss (kepten) - - jfcixmedia - Vitaliy Tverdokhlib (vitaliytv) - Martijn Evers - - Chris Heng - Nerijus Arlauskas - DerManoMann - Jochen Bayer (jocl) @@ -352,6 +387,7 @@ Symfony2 is the result of the work of many people who made the code better - Evan Villemez - Davide Borsatto (davide.borsatto) - kaiwa + - Albert Ganiev (helios-ag) - Neil Katin - Gustavo Adrian - Roger Webb @@ -365,8 +401,8 @@ 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 @@ -374,8 +410,6 @@ Symfony2 is the result of the work of many people who made the code better - Cédric Lahouste (rapotor) - Janusz Jablonski - George Giannoulopoulos - - Thomas Lallement (raziel057) - - Matt Daum (daum) - Alberto Pirovano (geezmo) - Xavier Briand (xavierbriand) - Evan Kaufman @@ -386,7 +420,6 @@ 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 @@ -406,30 +439,28 @@ 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) - - Roman Marintsenko (inori) - Ivan Kurnosov - stloyd - Martin Parsiegla (spea) - 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) - Philip Dahlstrøm (phidah) - - Pierre Vanliefland (pvanliefland) - Artem Lopata (bumz) - Alexey Popkov - Artyom Protaskin @@ -440,10 +471,12 @@ Symfony2 is the result of the work of many people who made the code better - hirocaster - Andrey Chernykh - Alexander Miehe (engerim) + - Jörn Lang (j.lang) - Jan Marek (janmarek) - Dan Patrick (mdpatrick) - Pierre-Yves LEBECQ (pylebecq) - Rares Vlaseanu (raresvla) + - Tugdual Saunier (tucksaun) - Alexander Zogheb - Florian Pfitzer - Linnik Sergey @@ -463,7 +496,6 @@ Symfony2 is the result of the work of many people who made the code better - Grummfy - Eduardo Gulias - Rowan Manning - - Eric GELOEN - David Windell - Gabriel Birke - Alan Chen @@ -517,7 +549,6 @@ Symfony2 is the result of the work of many people who made the code better - Samuel Laulhau - Oleg Stepura - James Michael DuPont - - Miha Vrhovnik - Ondrej Slinták - vlechemin - Skorney @@ -533,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 @@ -552,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) @@ -568,6 +599,7 @@ Symfony2 is the result of the work of many people who made the code better - Daniel Perez Pinazo (pitiflautico) - Ruud Kamphuis (ruudk) - Sebastian Busch (sebu) + - Simon Terrien (sterrien) - Markus Tacker (tacker) - Tyler Stroud (tystr) - Eugene Babushkin (warl) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 2a4080588e..60caf1d00c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -54,9 +54,13 @@ class Configuration implements ConfigurationInterface ->scalarNode('secret')->end() ->scalarNode('trust_proxy_headers')->defaultFalse()->end() // @deprecated, to be removed in 2.3 ->arrayNode('trusted_proxies') + ->beforeNormalization() + ->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/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index ddad0d1db6..42a331c584 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 @@ -24,6 +24,7 @@ + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 2f9a329d52..ce45492c28 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -53,11 +53,14 @@ 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' => '%kernel.debug%'), 'default_locale' => 'en', 'charset' => null)), 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' => '%kernel.debug%'), 'default_locale' => 'en', 'charset' => null)), 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' => '%kernel.debug%'), 'default_locale' => 'en', 'charset' => null)), + 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' => '%kernel.debug%'), 'default_locale' => 'en', 'charset' => null)), + 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' => '%kernel.debug%'), 'default_locale' => 'en', 'charset' => null)), + 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' => '%kernel.debug%'), 'default_locale' => 'en', 'charset' => null)), ); } /** - * @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 8b25687e7a..27988e2c2e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -4,6 +4,8 @@ $container->loadFromExtension('framework', array( 'secret' => 's3cr3t', 'default_locale' => 'fr', '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 703e2355fa..eacd416597 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 2a4fda9191..9eddd249d5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml @@ -2,6 +2,8 @@ framework: secret: s3cr3t default_locale: fr 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 a2c09e3ece..5e600fb9f8 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');