From e62c0b5a2d9633e1c229bfec23beaf3a87a6e425 Mon Sep 17 00:00:00 2001 From: Chekote Date: Mon, 10 Feb 2014 15:46:13 -0600 Subject: [PATCH 1/9] Fix "Array was modified outside object" in ResizeFormListener. The onSubmit() method of the ResizeFormListener class is assuming the data is an array, and calling unset directly inside a foreach. This works fine in most scenarios, but if data is an instance of IteratorAggregate, it breaks with the following error: Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener::onSubmit(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in ./vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php line 142 This is because the foreach loop is using an Iterator in the background, but the ResizeFormListener has unset the underlying data directly, causing the Iterator and data to be out of sync. When the data is an instance of IteratorAggregate, the loop should use the iterator directly and not rely on foreach. The onSubmit method has been updated accordingly. --- .../Core/EventListener/ResizeFormListener.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index f1c39db24542..d2b13e4a966a 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -139,9 +139,21 @@ public function onSubmit(FormEvent $event) // The data mapper only adds, but does not remove items, so do this // here if ($this->allowDelete) { - foreach ($data as $name => $child) { - if (!$form->has($name)) { - unset($data[$name]); + if ($data instanceof \IteratorAggregate) { + $iter = $data->getIterator(); + while ($iter->valid()) { + $name = $iter->key(); + if ($form->has($name)) { + $iter->next(); + } else { + $iter->offsetUnset($name); + } + } + } else { + foreach ($data as $name => $child) { + if (!$form->has($name)) { + unset($data[$name]); + } } } } From 23acd26d4a6f2c9a8448059d459e216f17818b10 Mon Sep 17 00:00:00 2001 From: Shane Preece Date: Tue, 11 Feb 2014 14:26:57 +0000 Subject: [PATCH 2/9] [DomCrawler] Added support for tags to be treated as links --- src/Symfony/Component/DomCrawler/Link.php | 4 ++-- src/Symfony/Component/DomCrawler/Tests/LinkTest.php | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DomCrawler/Link.php b/src/Symfony/Component/DomCrawler/Link.php index ae9c1948e214..d662f8937c85 100644 --- a/src/Symfony/Component/DomCrawler/Link.php +++ b/src/Symfony/Component/DomCrawler/Link.php @@ -12,7 +12,7 @@ namespace Symfony\Component\DomCrawler; /** - * Link represents an HTML link (an HTML a tag). + * Link represents an HTML link (an HTML a or area tag). * * @author Fabien Potencier * @@ -188,7 +188,7 @@ protected function canonicalizePath($path) */ protected function setNode(\DOMNode $node) { - if ('a' != $node->nodeName) { + if ('a' != $node->nodeName && 'area' != $node->nodeName) { throw new \LogicException(sprintf('Unable to click on a "%s" tag.', $node->nodeName)); } diff --git a/src/Symfony/Component/DomCrawler/Tests/LinkTest.php b/src/Symfony/Component/DomCrawler/Tests/LinkTest.php index e051f142ad3b..a17142830fdf 100644 --- a/src/Symfony/Component/DomCrawler/Tests/LinkTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/LinkTest.php @@ -74,6 +74,18 @@ public function testGetUri($url, $currentUri, $expected) $this->assertEquals($expected, $link->getUri()); } + /** + * @dataProvider getGetUriTests + */ + public function testGetUriOnArea($url, $currentUri, $expected) + { + $dom = new \DOMDocument(); + $dom->loadHTML(sprintf('', $url)); + $link = new Link($dom->getElementsByTagName('area')->item(0), $currentUri); + + $this->assertEquals($expected, $link->getUri()); + } + public function getGetUriTests() { return array( From 80bc41e38d0fa2282cdd445fb8d6f2dc58f26241 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 10 Feb 2014 22:05:36 +0100 Subject: [PATCH 3/9] [Console] removed problematic regex --- .../Console/Formatter/OutputFormatter.php | 94 ++++++++----------- .../application_renderexception3decorated.txt | 2 +- .../Tests/Formatter/OutputFormatterTest.php | 20 +++- 3 files changed, 60 insertions(+), 56 deletions(-) diff --git a/src/Symfony/Component/Console/Formatter/OutputFormatter.php b/src/Symfony/Component/Console/Formatter/OutputFormatter.php index d3c8c061ad0c..7b78882e347c 100644 --- a/src/Symfony/Component/Console/Formatter/OutputFormatter.php +++ b/src/Symfony/Component/Console/Formatter/OutputFormatter.php @@ -20,11 +20,6 @@ */ class OutputFormatter implements OutputFormatterInterface { - /** - * The pattern to phrase the format. - */ - const FORMAT_PATTERN = '#(\\\\?)<(/?)([a-z][a-z0-9_=;-]*)?>((?: [^<\\\\]+ | (?!<(?:/?[a-z]|/>)). | .(?<=\\\\<) )*)#isx'; - private $decorated; private $styles = array(); private $styleStack; @@ -147,9 +142,43 @@ public function getStyle($name) */ public function format($message) { - $message = preg_replace_callback(self::FORMAT_PATTERN, array($this, 'replaceStyle'), $message); + $offset = 0; + $output = ''; + $tagRegex = '[a-z][a-z0-9_=;-]*'; + preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE); + foreach ($matches[0] as $i => $match) { + $pos = $match[1]; + $text = $match[0]; + + // add the text up to the next tag + $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset)); + $offset = $pos + strlen($text); + + // opening tag? + if ($open = '/' != $text[1]) { + $tag = $matches[1][$i][0]; + } else { + $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : ''; + } + + if (!$open && !$tag) { + // + $this->styleStack->pop(); + } elseif ($pos && '\\' == $message[$pos - 1]) { + // escaped tag + $output .= $this->applyCurrentStyle($text); + } elseif (false === $style = $this->createStyleFromString(strtolower($tag))) { + $output .= $this->applyCurrentStyle($text); + } elseif ($open) { + $this->styleStack->push($style); + } else { + $this->styleStack->pop($style); + } + } + + $output .= $this->applyCurrentStyle(substr($message, $offset)); - return str_replace('\\<', '<', $message); + return str_replace('\\<', '<', $output); } /** @@ -160,53 +189,6 @@ public function getStyleStack() return $this->styleStack; } - /** - * Replaces style of the output. - * - * All escaped tags and tags that reference unknown styles are kept as is. - * - * @param array $match - * - * @return string The replaced style - */ - private function replaceStyle($match) - { - // we got "\<" escaped char - if ('\\' === $match[1]) { - return $this->applyCurrentStyle($match[0]); - } - - if ('' === $match[3]) { - if ('/' === $match[2]) { - // we got "" tag - $this->styleStack->pop(); - - return $this->applyCurrentStyle($match[4]); - } - - // we got "<>" tag - return '<>'.$this->applyCurrentStyle($match[4]); - } - - if (isset($this->styles[strtolower($match[3])])) { - $style = $this->styles[strtolower($match[3])]; - } else { - $style = $this->createStyleFromString($match[3]); - - if (false === $style) { - return $this->applyCurrentStyle($match[0]); - } - } - - if ('/' === $match[2]) { - $this->styleStack->pop($style); - } else { - $this->styleStack->push($style); - } - - return $this->applyCurrentStyle($match[4]); - } - /** * Tries to create new style instance from string. * @@ -216,6 +198,10 @@ private function replaceStyle($match) */ private function createStyleFromString($string) { + if (isset($this->styles[$string])) { + return $this->styles[$string]; + } + if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) { return false; } diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt index eb4181c2b4a9..4bdcd772caae 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt @@ -18,7 +18,7 @@    [Exception]  - First exception 

this is html

 + First exception 

this is html

    diff --git a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php index e8e4d61e350b..c8f0b987afd1 100644 --- a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php @@ -73,6 +73,16 @@ public function testNestedStyles() ); } + public function testAdjacentStyles() + { + $formatter = new OutputFormatter(true); + + $this->assertEquals( + "\033[37;41msome error\033[0m\033[32msome info\033[0m", + $formatter->format('some errorsome info') + ); + } + public function testStyleMatchingNotGreedy() { $formatter = new OutputFormatter(true); @@ -140,7 +150,15 @@ public function testInlineStyle() public function testNonStyleTag() { $formatter = new OutputFormatter(true); - $this->assertEquals("\033[32msome \033[0m\033[32m styled \033[0m\033[32m

single-char tag\033[0m\033[32m

\033[0m", $formatter->format('some styled

single-char tag

')); + + $this->assertEquals("\033[32msome \033[0m\033[32m\033[0m\033[32m styled \033[0m\033[32m

\033[0m\033[32msingle-char tag\033[0m\033[32m

\033[0m", $formatter->format('some styled

single-char tag

')); + } + + public function testFormatLongString() + { + $formatter = new OutputFormatter(true); + $long = str_repeat("\\", 14000); + $this->assertEquals("\033[37;41msome error\033[0m".$long, $formatter->format('some error'.$long)); } public function testNotDecoratedFormatter() From e4d1d048e15f131b58433b2fc20eafdb6d3af252 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Feb 2014 09:15:48 +0100 Subject: [PATCH 4/9] updated CHANGELOG for 2.3.10 --- CHANGELOG-2.3.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CHANGELOG-2.3.md b/CHANGELOG-2.3.md index 66d6819fbe5d..5f516a47e416 100644 --- a/CHANGELOG-2.3.md +++ b/CHANGELOG-2.3.md @@ -7,6 +7,38 @@ in 2.3 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1 +* 2.3.10 (2014-02-12) + + * bug #10231 [Console] removed problematic regex (fabpot) + * bug #10245 [DomCrawler] Added support for tags to be treated as links (shamess) + * bug #10232 [Form] Fix "Array was modified outside object" in ResizeFormListener. (Chekote) + * bug #10215 [Routing] reduced recursion in dumper (arnaud-lb) + * bug #10207 [DomCrawler] Fixed filterXPath() chaining (robbertkl) + * bug #10205 [DomCrawler] Fixed incorrect handling of image inputs (robbertkl) + * bug #10191 [HttpKernel] fixed wrong reference in TraceableEventDispatcher (fabpot) + * bug #10195 [Debug] Fixed recursion level incrementing in FlattenException::flattenArgs(). (sun) + * bug #10151 [Form] Update DateTime objects only if the actual value has changed (peterrehm) + * bug #10140 allow the TextAreaFormField to be used with valid/invalid HTML (dawehner) + * bug #10131 added lines to exceptions for the trans and transchoice tags (fabpot) + * bug #10119 [Validator] Minor fix in XmlFileLoader (florianv) + * bug #10078 [BrowserKit] add non-standard port to HTTP_HOST server param (kbond) + * bug #10091 [Translation] Update PluralizationRules.php (guilhermeblanco) + * bug #10053 [Form] fixed allow render 0 numeric input value (dczech) + * bug #10033 [HttpKernel] Bugfix - Logger Deprecation Notice (Rican7) + * bug #10023 [FrameworkBundle] Thrown an HttpException instead returning a Response in RedirectController::redirectAction() (jakzal) + * bug #9985 Prevent WDT from creating a session (mvrhov) + * bug #10000 [Console] Fixed the compatibility with HHVM (stof) + * bug #9979 [Doctrine Bridge][Validator] Fix for null values in assosiated properties when using UniqueEntityValidator (vpetrovych) + * bug #9983 [TwigBridge] Update min. version of Twig (stloyd) + * bug #9970 [CssSelector] fixed numeric attribute issue (jfsimon) + * bug #9747 [DoctrineBridge] Fix: Add type detection. Needed by pdo_dblib (iamluc) + * bug #9962 [Process] Fix #9861 : Revert TTY mode (romainneutron) + * bug #9960 [Form] Update minimal requirement in composer.json (stloyd) + * bug #9952 [Translator] Fix Empty translations with Qt files (vlefort) + * bug #9948 [WebProfilerBundle] Fixed profiler toolbar icons for XHTML. (rafalwrzeszcz) + * bug #9933 Propel1 exception message (jaugustin) + * bug #9949 [BrowserKit] Throw exception on invalid cookie expiration timestamp (anlutro) + * 2.3.9 (2014-01-05) * bug #9938 [Process] Add support SAPI cli-server (peter-gribanov) From a1b099df8f18e934376049c1e5b9900f1459cd45 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Feb 2014 09:17:42 +0100 Subject: [PATCH 5/9] update CONTRIBUTORS for 2.3.10 --- CONTRIBUTORS.md | 126 ++++++++++++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 48 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 57374a576ae5..9d4ce46dcaf6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -14,77 +14,76 @@ Symfony2 is the result of the work of many people who made the code better - Christophe Coevoet (stof) - Pascal Borreli (pborreli) - Karma Dordrak (drak) - - Ryan Weaver (weaverryan) - - Lukas Kahwe Smith (lsmith) - Jakub Zalas (jakubzalas) - Joseph Bielawski (stloyd) + - Ryan Weaver (weaverryan) + - Lukas Kahwe Smith (lsmith) - Jeremy Mikola (jmikola) - Jean-François Simon (jfsimon) - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) + - Hugo Hamon (hhamon) - Eriksen Costa (eriksencosta) - Martin Hasoň (hason) - - Hugo Hamon (hhamon) - Jonathan Wage (jwage) - Alexandre Salomé (alexandresalome) - - William DURAND - - ornicar + - William Durand (couac) - Romain Neutron (romain) + - ornicar - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - Bulat Shakirzyanov (avalanche123) - Francis Besset (francisbesset) - Miha Vrhovnik - Henrik Bjørnskov (henrikbjorn) + - Grégoire Pineau (lyrixx) - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) - Florin Patan (florinpatan) - - Grégoire Pineau (lyrixx) - Saša Stamenković (umpirsky) - - hhamon - Eric Clemmons (ericclemmons) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) + - Wouter De Jong (wouterj) - Arnout Boks (aboks) - Andrej Hudec (pulzarraider) - - Wouter De Jong (wouterj) - Lee McDermott - Brandon Turner - Daniel Holmes (dholmes) - Jordan Alliot (jalliot) + - Christian Raue - Douglas Greenshields (shieldo) - John Wards (johnwards) - Fran Moreno (franmomu) - Bart van den Burg (burgov) - - Christian Raue - Antoine Hérault (herzult) - Toni Uebernickel (havvg) - Michel Weimerskirch (mweimerskirch) - - Brice BERNARD (brikou) - Arnaud Le Blanc (arnaud-lb) + - Brice BERNARD (brikou) + - Kevin Bond (kbond) - marc.weistroff - lenar - Tim Nagel (merk) - Włodzimierz Gajda (gajdaw) - - Kevin Bond (kbond) - Colin Frei - excelwebzone - Fabien Pennequin (fabienpennequin) + - Luis Cordova (cordoval) - Jacob Dreesen (jdreesen) - Adrien Brault (adrienbrault) - Michal Piotrowski (eventhorizon) - - Luis Cordova (cordoval) - Robert Schönthal (digitalkaoz) - Juti Noppornpitak (shiroyuki) - Sebastian Hörl (blogsh) - Hidenori Goto (hidenorigoto) - Gábor Egyed (1ed) + - Daniel Gomes (danielcsgomes) + - Jérémie Augustin (jaugustin) - David Buchmann (dbu) - Ait Boudad Abdellatif (aitboudad) - - Daniel Gomes (danielcsgomes) - Peter Kokot (maastermedia) - - Jérémie Augustin (jaugustin) - Tigran Azatyan (tigranazatyan) - Javier Eguiluz (javier.eguiluz) - Rafael Dohms (rdohms) @@ -96,6 +95,7 @@ Symfony2 is the result of the work of many people who made the code better - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba + - Guilherme Blanco (guilhermeblanco) - Pablo Godel (pgodel) - Eric GELOEN (gelo) - Jérôme Tamarelle (gromnan) @@ -108,19 +108,19 @@ Symfony2 is the result of the work of many people who made the code better - Arnaud Kleinpeter (nanocom) - Mario A. Alvarez Garcia (nomack84) - Dennis Benkert (denderello) + - Rouven Weßling (realityking) - Benjamin Dulau (dbenjamin) - Andreas Hucks (meandmymonkey) - Noel Guilbert (noel) - bronze1man - Larry Garfield (crell) - - Guilherme Blanco (guilhermeblanco) - Martin Schuhfuß (usefulthink) - Thomas Rabaix (rande) - Matthieu Bontemps (mbontemps) - Pierre Minnieur (pminnieur) - fivestar - Dominique Bongiraud - - Rouven Weßling (realityking) + - Florian Voutzinos (florianv) - Leszek Prabucki (l3l0) - François Zaninotto (fzaninotto) - Dustin Whittle (dustinwhittle) @@ -128,6 +128,7 @@ Symfony2 is the result of the work of many people who made the code better - Clemens Tolboom - Justin Hileman (bobthecow) - Sven Paulus (subsven) + - Andréia Bohner (andreia) - Joel Wurtz (brouznouf) - Rui Marinho (ruimarinho) - Julien Brochet (mewt) @@ -140,7 +141,7 @@ Symfony2 is the result of the work of many people who made the code better - Xavier Perez - Arjen Brouwer (arjenjb) - Katsuhiro OGAWA - - Andréia Bohner (andreia) + - Peter Rehm (rpet) - Alif Rachmawadi - Matthias Pigulla (mpdude) - Joseph Rouff (rouffj) @@ -153,18 +154,20 @@ Symfony2 is the result of the work of many people who made the code better - Albert Casademont (acasademont) - jdhoek - Wodor Wodorski + - Daniel Tschinder - Elnur Abdurrakhimov (elnur) - Beau Simensen (simensen) - Robert Kiss (kepten) - - Kim Hemsø Rasmussen + - Kim Hemsø Rasmussen (kimhemsoe) - Wouter Van Hecke - Michael Holm (hollo) - - Peter Rehm (rpet) - Marc Weistroff (futurecat) - Roman Marintšenko (inori) - Florian Klein (docteurklein) - Manuel Kiessling (manuelkiessling) + - Lars Strojny (lstrojny) - Bertrand Zuchuat (garfield-fr) + - sun (sun) - Gabor Toth (tgabi333) - Thomas Tourlourat (armetiz) - Andrey Esaulov (andremaha) @@ -193,6 +196,7 @@ Symfony2 is the result of the work of many people who made the code better - Peter Kruithof (pkruithof) - Felix Labrecque - Yaroslav Kiliba + - Sébastien Lavoie (lavoiesl) - Pierre-Yves LEBECQ (pylebecq) - Terje Bråten - Kristen Gilden (kgilden) @@ -202,10 +206,9 @@ Symfony2 is the result of the work of many people who made the code better - Kirill chEbba Chebunin (chebba) - Greg Thornton (xdissent) - Atsuhiro KUBO (iteman) - - sun (sun) - - Lars Strojny - Costin Bereveanu (schniper) - Loïc Chardonnet (gnusat) + - Marek Kalnik (marekkalnik) - realmfoo - Tamas Szijarto - Pavel Volokitin (pvolok) @@ -226,12 +229,12 @@ Symfony2 is the result of the work of many people who made the code better - Oscar Cubo Medina (ocubom) - Karel Souffriau - Christophe L. (christophelau) + - Anthon Pang (robocoder) - Jáchym Toušek - Emanuele Gaspari (inmarelibero) - Brian King - Michel Salib (michelsalib) - geoffrey - - Florian Voutzinos (florianv) - Nikita Konstantinov - Jeanmonod David (jeanmonod) - Jan Schumann @@ -240,7 +243,8 @@ Symfony2 is the result of the work of many people who made the code better - lancergr - Antonio J. García Lagar (ajgarlag) - Olivier Dolbeau (odolbeau) - - Daniel Tschinder + - Roumen Damianoff (roumen) + - Tobias Sjösten (tobiassjosten) - alquerci - vagrant - Asier Illarramendi (doup) @@ -248,7 +252,6 @@ Symfony2 is the result of the work of many people who made the code better - Vitaliy Tverdokhlib (vitaliytv) - Dirk Pahl (dirkaholic) - Jonas Flodén (flojon) - - Sébastien Lavoie (lavoiesl) - Marcin Sikoń (marphi) - franek (franek) - Adam Harvey @@ -283,9 +286,8 @@ Symfony2 is the result of the work of many people who made the code better - sasezaki - Denis Gorbachev (starfall) - Steven Surowiec - - Marek Kalnik (marekkalnik) - Chris Smith - - Anthon Pang + - Daniel Tschinder - Ryan - Alexander Deruwe (aderuwe) - François Pluchino (francoispluchino) @@ -311,16 +313,16 @@ Symfony2 is the result of the work of many people who made the code better - Konstantin Myakshin (koc) - Nahuel Cuesta (ncuesta) - Chris Boden (cboden) - - Roumen Damianoff (roumen) - Pierre du Plessis (pierredup) - Josip Kruslin + - Wang Jingyu - Åsmund Garfors - Javier López (loalf) - - Tobias Sjösten (tobiassjosten) - Dustin Dobervich (dustin10) - Sebastian Marek (proofek) - Erkhembayar Gantulga (erheme318) - Kamil Kokot (pamil) + - Florian Lonqueu-Brochard (florianlb) - Rostyslav Kinash - Vincent Simonin - Stefan Warman @@ -329,6 +331,7 @@ Symfony2 is the result of the work of many people who made the code better - Miquel Rodríguez Telep (mrtorrent) - umpirski - Chris Heng (gigablah) + - Ulumuddin Yunus (joenoez) - Antoine Corcy - cedric lombardot (cedriclombardot) - John Kary (johnkary) @@ -341,9 +344,13 @@ Symfony2 is the result of the work of many people who made the code better - Evan Villemez - fzerorubigd - Tiago Brito (blackmx) + - Richard van den Brand (ricbra) - develop + - Robbert Klarenbeek (robbertkl) - Tomasz Kowalczyk (thunderer) - Mark Sonnabaum + - Mathieu Lemoine + - jochenvdv - Filippo Tessarotto - Arturas Smorgun (asarturas) - Alexander Volochnev (exelenz) @@ -352,7 +359,7 @@ Symfony2 is the result of the work of many people who made the code better - Pascal Helfenstein - Baldur Rensch (brensch) - Alex Xandra Albert Sim - - florianv + - Daniel Wehner - Yuen-Chi Lian - Besnik Br - Joshua Nye @@ -376,6 +383,7 @@ Symfony2 is the result of the work of many people who made the code better - Xavier Lacot (xavier) - Olivier Maisonneuve (olineuve) - Francis Turmel (fturmel) + - Nicolas Grekas (nicolas-grekas) - cgonzalez - Jayson Xu (superjavason) - Jaik Dean (jaikdean) @@ -384,7 +392,7 @@ Symfony2 is the result of the work of many people who made the code better - Tom Klingenberg - Christopher Hall (mythmakr) - Paul Kamer (pkamer) - - Thomas Ploch (tploch) + - Rafał Wrzeszcz (rafalwrzeszcz) - Reen Lokum - Martin Parsiegla (spea) - Pierre Vanliefland (pvanliefland) @@ -423,6 +431,7 @@ Symfony2 is the result of the work of many people who made the code better - Thibault Duplessis - Marc Abramowitz - Martijn Evers + - Jacques Moati - Harry Walter (haswalt) - Michael Roterman (wtfzdotnet) - Arno Geurts @@ -445,9 +454,11 @@ Symfony2 is the result of the work of many people who made the code better - Ben Ramsey (ramsey) - Christian Jul Jensen - The Whole Life to Learn + - Phan Thanh Ha (haphan) - Chris Jones (leek) - xaav - Mahmoud Mostafa (mahmoud) + - Ricky Su (ricky) - Radosław Benkel - ttomor - Mei Gwilym (meigwilym) @@ -470,12 +481,13 @@ Symfony2 is the result of the work of many people who made the code better - Wojciech Sznapka - Máximo Cuadros (mcuadros) - Alex Bogomazov + - tamirvs - julien.galenski - Christian Schmidt - Per Sandström (per) + - Goran Juric - Lin Clark - Jeremy David (jeremy.david) - - Florian Lonqueu-Brochard (florianlb) - Troy McCabe - Ville Mattila - Ben Davies @@ -508,8 +520,8 @@ Symfony2 is the result of the work of many people who made the code better - Benoit Garret - DerManoMann - Roland Franssen (ro0) - - Mathieu Lemoine - Rodrigo Díez Villamuera (rodrigodiez) + - e-ivanov - Jochen Bayer (jocl) - Jeremy Bush - Péter Buri (burci) @@ -521,6 +533,7 @@ Symfony2 is the result of the work of many people who made the code better - Artem Kolesnikov (tyomo4ka) - Gustavo Adrian - Clément Gautier (clementgautier) + - Luc Vieillescazes (iamluc) - David de Boer (ddeboer) - Brooks Boyd - Roger Webb @@ -531,7 +544,7 @@ Symfony2 is the result of the work of many people who made the code better - Krzysztof Przybyszewski - Paul Matthews - Juan Traverso - - Jerzy Zawadzki + - Jerzy Zawadzki (jzawadzki) - Philipp Strube - Christian Sciberras - Clement Herreman (clemherreman) @@ -540,24 +553,26 @@ Symfony2 is the result of the work of many people who made the code better - Alberto Aldegheri - heccjj - Alexandre Melard - - endroid - Sergey Yuferev - Mo Di (modi) - - Richard van den Brand (ricbra) + - Jeroen van den Enden (stoefke) - Quique Porta (quiqueporta) - Tomasz Szymczyk (karion) + - ConneXNL - Aharon Perkel + - Abdul.Mohsen B. A. A - Malaney J. Hill - Cédric Girard (enk_) + - Oriol Mangas Abellan (oriolman) - Sebastian Göttschkes (sgoettschkes) - Kévin Gomez (kevin) - - Pierre Tachoire - - marcj - Ludek Stepan - Balázs Benyó (duplabe) - Erika Heidi Reinaldo (erikaheidi) + - Pierre Tachoire (krichprollsch) + - Marc J. Schmidt (marcjs) - Marc Morera (mmoreram) - - Daniel Wehner + - Marco Jantke - Saem Ghani - Sebastian Utz - Karol Sójko (karolsojko) @@ -583,6 +598,7 @@ Symfony2 is the result of the work of many people who made the code better - Alberto Pirovano (geezmo) - Martin Pärtel - Evgeniy (ewgraf) + - Patrick Daley (padrig) - Xavier Briand (xavierbriand) - WedgeSama - Romain Geissler @@ -601,20 +617,23 @@ Symfony2 is the result of the work of many people who made the code better - Martin Eckhardt - Jon Gotlin (jongotlin) - Michael Dowling (mtdowling) - - Nicolas Grekas (nicolas-grekas) - BilgeXA + - r1pp3rj4ck - Robert Queck - mlively - Dennis Hotson - Fabian Steiner (fabstei) + - Klaus Silveira (klaussilveira) - Thomas Chmielowiec (chmielot) - Jānis Lukss + - Vladyslav Petrovych - Matthew J Mucklo - fdgdfg (psampaz) - Maxwell Vandervelde - kaywalker - Mike Meier - Sebastian Ionescu + - Thomas Ploch - Simon Neidhold - Kevin Dew - James Cowgill @@ -640,13 +659,12 @@ Symfony2 is the result of the work of many people who made the code better - Alessandro Tagliapietra (alex88) - Gunnar Lium (gunnarlium) - Tiago Garcia (tiagojsag) - - Lars Strojny - Bouke Haarsma - Harm van Tilborg - Martin Eckhardt - - Leonid Terentyev - Jonathan Poston - Przemysław Piechota (kibao) + - Leonid Terentyev (li0n) - Adam Prager (padam87) - Francisco Facioni (fran6co) - Iwan van Staveren (istaveren) @@ -666,12 +684,14 @@ Symfony2 is the result of the work of many people who made the code better - Andrew Coulton - David Stone - Luis Muñoz + - Andreas - Strate - Thomas Chmielowiec - Gunther Konig - František Bereň - Benjamin Grandfond (benjamin) - Christoph Nissle (derstoffel) + - Ionel Scutelnicu (ionelscutelnicu) - Johnny Peck (johnnypeck) - Nicolas Tallefourtané (nicolab) - jjanvier @@ -686,6 +706,7 @@ Symfony2 is the result of the work of many people who made the code better - alsar - Mike Meier - Warwick + - Chris - efeen - Dominik Zogg (dominik.zogg) - Simone Fumagalli (hpatoio) @@ -705,21 +726,24 @@ Symfony2 is the result of the work of many people who made the code better - helmer - Daan van Renterghem - Bram Van der Sype (brammm) + - Inal DJAFAR (inalgnu) - Julien Moulin (lizjulien) - Matthieu Auger (matthieuauger) - dened - devel + - Trevor Suarez - gedrox - dropfen - Andrey Chernykh - Drew Butler - Alexey Prilipko - Jan Marek (janmarek) + - Mark de Haan (markdehaan) - Dan Patrick (mdpatrick) - Rares Vlaseanu (raresvla) - tante kinast (tante) + - Vincent LEFORT (vlefort) - Alexander Zogheb - - Florian Pfitzer - Joel Marcey - David Christmann - root @@ -730,6 +754,7 @@ Symfony2 is the result of the work of many people who made the code better - Dan Ordille (dordille) - Jan Eichhorn (exeu) - Julien DIDIER (juliendidier) + - Florian Pfitzer (marmelatze) - Martin Mayer (martin) - Grzegorz Łukaszewicz (newicz) - Robert Campbell @@ -747,7 +772,6 @@ Symfony2 is the result of the work of many people who made the code better - Alan Chen - Maerlyn - Even André Fiskvik - - Franz Liedke - Lenar Lõhmus - Cristian Gonzalez - Juan M Martínez @@ -757,11 +781,13 @@ Symfony2 is the result of the work of many people who made the code better - Klaas Naaijkens - Rafał - Masao Maeda (brtriver) + - Dave Hulbert (dave1010) - Dave Marshall (davedevelopment) - David Joos (djoos) - Denis Klementjev (dklementjev) - Kévin Dunglas (dunglas) - Vincent Composieux (eko) + - Franz Liedke (franzliedke) - gondo (gondo) - Osman Üngür (import) - Jorge Martin (jorgemartind) @@ -771,7 +797,6 @@ Symfony2 is the result of the work of many people who made the code better - Muriel (metalmumu) - Michaël Perrin (michael.perrin) - Pablo Monterde Perez (plebs) - - Rafał Wrzeszcz (rafalwrzeszcz) - Jimmy Leger (redpanda) - Cyrille Jouineau (tuxosaurus) - Yorkie Chadwick (yorkie76) @@ -783,7 +808,6 @@ Symfony2 is the result of the work of many people who made the code better - Gladhon - Saem Ghani - Stefan Oderbolz - - Daniel Tschinder - Alexey Popkov - Joseph Deray - Arnaud Buathier (arnapou) @@ -799,6 +823,7 @@ Symfony2 is the result of the work of many people who made the code better - Wotre - goohib - Xavier HAUSHERR + - Cas - Myke79 - Brian Debuire - Sylvain Lorinet @@ -809,6 +834,7 @@ Symfony2 is the result of the work of many people who made the code better - Antonio Angelino - Quentin Schuler - Vladimir Sazhin + - lol768 - jamogon - Vyacheslav Slinko - Johannes @@ -816,7 +842,9 @@ Symfony2 is the result of the work of many people who made the code better - wesleyh - Michael Genereux - patrick-mcdougle + - Dariusz Czech - Anonymous User + - cmfcmf - Drew Butler - Steve Müller - andreabreu98 @@ -832,9 +860,9 @@ Symfony2 is the result of the work of many people who made the code better - Skorney - mieszko4 - datibbaw - - Norbert Orzechowicz - Markus Staab - Pierre-Louis LAUNAY + - Thomas Ploch - djama - Eduardo Conceição - Jon Cave @@ -844,6 +872,7 @@ Symfony2 is the result of the work of many people who made the code better - Thorsten Hallwas - Daisuke Ohata - Michael Squires + - Peter Gribanov - Chris Smith - kwiateusz - David Soria Parra @@ -854,6 +883,7 @@ Symfony2 is the result of the work of many people who made the code better - DanSync - Peter Zwosta - parhs + - TeLiXj - Oncle Tom - Christian Stocker - tirnanog06 @@ -867,10 +897,10 @@ Symfony2 is the result of the work of many people who made the code better - Jannik Zschiesche (apfelbox) - Juan Ases García (ases) - Daniel Basten (axhm3a) + - Bill Hance (billhance) - Bernd Matzner (bmatzner) - Chris Sedlmayr (catchamonkey) - Kousuke Ebihara (co3k) - - Cas Leentfaar (codeklopper) - Loïc Vernet (coil) - Christoph Schaefer (cvschaefer) - Damien Alexandre (damienalexandre) @@ -898,6 +928,7 @@ Symfony2 is the result of the work of many people who made the code better - Moritz Borgmann (mborgmann) - Matt Drollette (mdrollette) - Adam Monsen (meonkeys) + - Norbert Orzechowicz (norzechowicz) - ollie harridge (ollietb) - Paweł Szczepanek (pauluz) - Petr Jaroš (petajaros) @@ -925,7 +956,6 @@ Symfony2 is the result of the work of many people who made the code better - Andreas Streichardt - smokeybear87 - Gustavo Adrian - - Anthon Pang - Michael - fh-github@fholzhauer.de - Xavier REN From e4b9ff28b7c357971947ed12f99fbc68ff116830 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Feb 2014 09:18:23 +0100 Subject: [PATCH 6/9] updated VERSION for 2.3.10 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index a179efca3af5..d2df064eea4c 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.3.10-DEV'; + const VERSION = '2.3.10'; const VERSION_ID = '20310'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '3'; const RELEASE_VERSION = '10'; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; /** * Constructor. From 8fef4f039816d31cecedcd5c447ab140b6a7daf9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 12 Feb 2014 20:09:09 +0100 Subject: [PATCH 7/9] bumped Symfony version to 2.3.11 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index d2df064eea4c..8609547ba3d9 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.3.10'; - const VERSION_ID = '20310'; + const VERSION = '2.3.11-DEV'; + const VERSION_ID = '20311'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '3'; - const RELEASE_VERSION = '10'; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = '11'; + const EXTRA_VERSION = 'DEV'; /** * Constructor. From 462b7af9b18a4449ae0d038c2ed8369c625f0e27 Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Sat, 15 Feb 2014 12:00:54 +0100 Subject: [PATCH 8/9] Added failing test --- .../Core/EventListener/ResizeFormListenerTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php index 1367b3ef02f4..3c162654dddc 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; +use Doctrine\Common\Collections\ArrayCollection; use Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener; use Symfony\Component\Form\FormBuilder; use Symfony\Component\Form\FormEvent; @@ -252,4 +253,17 @@ public function testOnSubmitNormDataDealsWithNullData() $this->assertEquals(array(), $event->getData()); } + + public function testOnSubmitDealsWithIteratorAggregate() + { + $this->form->add($this->getForm('1')); + + $data = new ArrayCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener('text', array(), false, true); + $listener->onSubmit($event); + + $this->assertArrayNotHasKey(0, $event->getData()); + $this->assertArrayNotHasKey(2, $event->getData()); + } } From f62e30db304ab14d4285c4cbf817448fd6ad8511 Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Sat, 15 Feb 2014 12:03:01 +0100 Subject: [PATCH 9/9] Revert "Fix "Array was modified outside object" in ResizeFormListener." --- .../Core/EventListener/ResizeFormListener.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index d2b13e4a966a..f1c39db24542 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -139,21 +139,9 @@ public function onSubmit(FormEvent $event) // The data mapper only adds, but does not remove items, so do this // here if ($this->allowDelete) { - if ($data instanceof \IteratorAggregate) { - $iter = $data->getIterator(); - while ($iter->valid()) { - $name = $iter->key(); - if ($form->has($name)) { - $iter->next(); - } else { - $iter->offsetUnset($name); - } - } - } else { - foreach ($data as $name => $child) { - if (!$form->has($name)) { - unset($data[$name]); - } + foreach ($data as $name => $child) { + if (!$form->has($name)) { + unset($data[$name]); } } }