From 54d7d258c1039a085b3773b53baa7e2b2c018c76 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Fri, 15 Feb 2013 22:21:39 +0100 Subject: [PATCH 01/17] [HttpKernel] hinclude fragment renderer must escape URIs properly to return valid html --- .../Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php | 3 +++ .../HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php index bd057169b0..ceea7bbf78 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php @@ -64,6 +64,9 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer $uri = $this->signer->sign($this->generateFragmentUri($uri, $request)); } + // We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content. + $uri = str_replace('&', '&', $uri); + $template = isset($options['default']) ? $options['default'] : $this->globalDefaultTemplate; if (null !== $this->templating && $template && $this->templateExists($template)) { $content = $this->templating->render($template); diff --git a/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php index 76fd720a45..1e77374901 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php @@ -38,7 +38,7 @@ class HIncludeFragmentRendererTest extends \PHPUnit_Framework_TestCase { $strategy = new HIncludeFragmentRenderer(null, new UriSigner('foo')); - $this->assertEquals('', $strategy->render(new ControllerReference('main_controller', array(), array()), Request::create('/'))->getContent()); + $this->assertEquals('', $strategy->render(new ControllerReference('main_controller', array(), array()), Request::create('/'))->getContent()); } public function testRenderWithUri() From 189fba6d0fdccdf1724d5778543a6d9f7fa2feb0 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Mon, 18 Feb 2013 23:37:06 +0100 Subject: [PATCH 02/17] Removed some leaking deprecation warning in the Form component Fixes #7101 --- .../Tests/Form/Type/EntityTypeTest.php | 42 +++++++++---------- .../Component/Form/ResolvedFormType.php | 2 + .../Extension/Core/Type/FormTypeTest.php | 2 + .../Extension/Core/Type/MoneyTypeTest.php | 4 +- .../Extension/Core/Type/TimeTypeTest.php | 2 +- .../Form/Tests/FormIntegrationTestCase.php | 7 ---- 6 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php index d3f9185131..4d23db4ef8 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php @@ -209,7 +209,7 @@ class EntityTypeTest extends TypeTestCase $field->setData(null); $this->assertNull($field->getData()); - $this->assertSame('', $field->getClientData()); + $this->assertSame('', $field->getViewData()); } public function testSetDataMultipleExpandedNull() @@ -223,7 +223,7 @@ class EntityTypeTest extends TypeTestCase $field->setData(null); $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getClientData()); + $this->assertSame(array(), $field->getViewData()); } public function testSetDataMultipleNonExpandedNull() @@ -237,7 +237,7 @@ class EntityTypeTest extends TypeTestCase $field->setData(null); $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getClientData()); + $this->assertSame(array(), $field->getViewData()); } public function testSubmitSingleExpandedNull() @@ -251,7 +251,7 @@ class EntityTypeTest extends TypeTestCase $field->bind(null); $this->assertNull($field->getData()); - $this->assertSame(array(), $field->getClientData()); + $this->assertSame(array(), $field->getViewData()); } public function testSubmitSingleNonExpandedNull() @@ -265,7 +265,7 @@ class EntityTypeTest extends TypeTestCase $field->bind(null); $this->assertNull($field->getData()); - $this->assertSame('', $field->getClientData()); + $this->assertSame('', $field->getViewData()); } public function testSubmitMultipleNull() @@ -278,7 +278,7 @@ class EntityTypeTest extends TypeTestCase $field->bind(null); $this->assertEquals(new ArrayCollection(), $field->getData()); - $this->assertSame(array(), $field->getClientData()); + $this->assertSame(array(), $field->getViewData()); } public function testSubmitSingleNonExpandedSingleIdentifier() @@ -300,7 +300,7 @@ class EntityTypeTest extends TypeTestCase $this->assertTrue($field->isSynchronized()); $this->assertSame($entity2, $field->getData()); - $this->assertSame('2', $field->getClientData()); + $this->assertSame('2', $field->getViewData()); } public function testSubmitSingleNonExpandedCompositeIdentifier() @@ -323,7 +323,7 @@ class EntityTypeTest extends TypeTestCase $this->assertTrue($field->isSynchronized()); $this->assertSame($entity2, $field->getData()); - $this->assertSame('1', $field->getClientData()); + $this->assertSame('1', $field->getViewData()); } public function testSubmitMultipleNonExpandedSingleIdentifier() @@ -348,7 +348,7 @@ class EntityTypeTest extends TypeTestCase $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('1', '3'), $field->getClientData()); + $this->assertSame(array('1', '3'), $field->getViewData()); } public function testSubmitMultipleNonExpandedSingleIdentifierForExistingData() @@ -379,7 +379,7 @@ class EntityTypeTest extends TypeTestCase $this->assertEquals($expected, $field->getData()); // same object still, useful if it is a PersistentCollection $this->assertSame($existing, $field->getData()); - $this->assertSame(array('1', '3'), $field->getClientData()); + $this->assertSame(array('1', '3'), $field->getViewData()); } public function testSubmitMultipleNonExpandedCompositeIdentifier() @@ -405,7 +405,7 @@ class EntityTypeTest extends TypeTestCase $this->assertTrue($field->isSynchronized()); $this->assertEquals($expected, $field->getData()); - $this->assertSame(array('0', '2'), $field->getClientData()); + $this->assertSame(array('0', '2'), $field->getViewData()); } public function testSubmitMultipleNonExpandedCompositeIdentifierExistingData() @@ -436,7 +436,7 @@ class EntityTypeTest extends TypeTestCase $this->assertEquals($expected, $field->getData()); // same object still, useful if it is a PersistentCollection $this->assertSame($existing, $field->getData()); - $this->assertSame(array('0', '2'), $field->getClientData()); + $this->assertSame(array('0', '2'), $field->getViewData()); } public function testSubmitSingleExpanded() @@ -460,8 +460,8 @@ class EntityTypeTest extends TypeTestCase $this->assertSame($entity2, $field->getData()); $this->assertFalse($field['1']->getData()); $this->assertTrue($field['2']->getData()); - $this->assertNull($field['1']->getClientData()); - $this->assertSame('2', $field['2']->getClientData()); + $this->assertNull($field['1']->getViewData()); + $this->assertSame('2', $field['2']->getViewData()); } public function testSubmitMultipleExpanded() @@ -489,9 +489,9 @@ class EntityTypeTest extends TypeTestCase $this->assertTrue($field['1']->getData()); $this->assertFalse($field['2']->getData()); $this->assertTrue($field['3']->getData()); - $this->assertSame('1', $field['1']->getClientData()); - $this->assertNull($field['2']->getClientData()); - $this->assertSame('3', $field['3']->getClientData()); + $this->assertSame('1', $field['1']->getViewData()); + $this->assertNull($field['2']->getViewData()); + $this->assertSame('3', $field['3']->getViewData()); } public function testOverrideChoices() @@ -515,7 +515,7 @@ class EntityTypeTest extends TypeTestCase $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); $this->assertTrue($field->isSynchronized()); $this->assertSame($entity2, $field->getData()); - $this->assertSame('2', $field->getClientData()); + $this->assertSame('2', $field->getViewData()); } public function testGroupByChoices() @@ -537,7 +537,7 @@ class EntityTypeTest extends TypeTestCase $field->bind('2'); - $this->assertSame('2', $field->getClientData()); + $this->assertSame('2', $field->getViewData()); $this->assertEquals(array( 'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')), 'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')), @@ -716,7 +716,7 @@ class EntityTypeTest extends TypeTestCase $this->assertTrue($field->isSynchronized()); $this->assertSame($entity1, $field->getData()); - $this->assertSame('foo', $field->getClientData()); + $this->assertSame('foo', $field->getViewData()); } public function testSubmitCompositeStringIdentifier() @@ -738,7 +738,7 @@ class EntityTypeTest extends TypeTestCase $this->assertTrue($field->isSynchronized()); $this->assertSame($entity1, $field->getData()); - $this->assertSame('0', $field->getClientData()); + $this->assertSame('0', $field->getViewData()); } public function testGetManagerForClassIfNoEm() diff --git a/src/Symfony/Component/Form/ResolvedFormType.php b/src/Symfony/Component/Form/ResolvedFormType.php index d889d0df5a..d20f3b390f 100644 --- a/src/Symfony/Component/Form/ResolvedFormType.php +++ b/src/Symfony/Component/Form/ResolvedFormType.php @@ -62,7 +62,9 @@ class ResolvedFormType implements ResolvedFormTypeInterface // BC if ($innerType instanceof AbstractType) { /* @var AbstractType $innerType */ + set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handleBC')); $innerType->setExtensions($typeExtensions); + restore_error_handler(); } $this->innerType = $innerType; diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php index fae4ae3e5b..f77b8517d4 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php @@ -601,9 +601,11 @@ class FormTypeTest extends TypeTestCase // BC public function testPropertyPathFalseImpliesDefaultNotMapped() { + set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); $form = $this->factory->createNamed('name', 'form', null, array( 'property_path' => false, )); + restore_error_handler(); $this->assertEquals(new PropertyPath('name'), $form->getPropertyPath()); $this->assertFalse($form->getConfig()->getMapped()); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php index d3e2932c01..9eadaac2c4 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php @@ -42,7 +42,7 @@ class MoneyTypeTest extends LocalizedTestCase $view1 = $form1->createView(); $view2 = $form2->createView(); - $this->assertSame('{{ widget }} £', $view1->get('money_pattern')); - $this->assertSame('{{ widget }} €', $view2->get('money_pattern')); + $this->assertSame('{{ widget }} £', $view1->vars['money_pattern']); + $this->assertSame('{{ widget }} €', $view2->vars['money_pattern']); } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php index 72270c7f9a..1277097103 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php @@ -231,7 +231,7 @@ class TimeTypeTest extends LocalizedTestCase $form->setData(new \DateTime('03:04:05 UTC')); - $this->assertEquals(array('hour' => 3), $form->getClientData()); + $this->assertEquals(array('hour' => 3), $form->getViewData()); } public function testSetDataWithSeconds() diff --git a/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php b/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php index fad0616280..536ff4c824 100644 --- a/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php +++ b/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php @@ -32,13 +32,6 @@ abstract class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase $this->factory = Forms::createFormFactoryBuilder() ->addExtensions($this->getExtensions()) ->getFormFactory(); - - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - } - - protected function tearDown() - { - restore_error_handler(); } protected function getExtensions() From 39339121d6732cfd562958c352b18fccdb131eb3 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 19 Feb 2013 08:24:52 +0100 Subject: [PATCH 03/17] fixed HInclude renderer (closes #7113) --- ...ContainerAwareHIncludeFragmentRenderer.php | 4 ++- ...ainerAwareHIncludeFragmentRendererTest.php | 30 +++++++++++++++++++ .../Fragment/HIncludeFragmentRenderer.php | 10 +++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Fragments/ContainerAwareHIncludeFragmentRendererTest.php diff --git a/src/Symfony/Bundle/FrameworkBundle/Fragment/ContainerAwareHIncludeFragmentRenderer.php b/src/Symfony/Bundle/FrameworkBundle/Fragment/ContainerAwareHIncludeFragmentRenderer.php index da273cd7a7..82c6a0b2b7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Fragment/ContainerAwareHIncludeFragmentRenderer.php +++ b/src/Symfony/Bundle/FrameworkBundle/Fragment/ContainerAwareHIncludeFragmentRenderer.php @@ -40,7 +40,9 @@ class ContainerAwareHIncludeFragmentRenderer extends HIncludeFragmentRenderer */ public function render($uri, Request $request, array $options = array()) { - if (!$this->templating) { + // setting the templating cannot be done in the constructor + // as it would lead to an infinite recursion in the service container + if (!$this->hasTemplating()) { $this->setTemplating($this->container->get('templating')); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fragments/ContainerAwareHIncludeFragmentRendererTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Fragments/ContainerAwareHIncludeFragmentRendererTest.php new file mode 100644 index 0000000000..546d48bc0b --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fragments/ContainerAwareHIncludeFragmentRendererTest.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Fragment; + +use Symfony\Bundle\FrameworkBundle\Tests\TestCase; +use Symfony\Bundle\FrameworkBundle\Fragment\ContainerAwareHIncludeFragmentRenderer; +use Symfony\Component\HttpFoundation\Request; + +class ContainerAwareHIncludeFragmentRendererTest extends TestCase +{ + public function testRender() + { + $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $container->expects($this->once()) + ->method('get') + ->will($this->returnValue($this->getMock('\Twig_Environment'))) + ; + $renderer = new ContainerAwareHIncludeFragmentRenderer($container); + $renderer->render('/', Request::create('/')); + } +} diff --git a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php index 1f6c2634bf..8b5610b31d 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php @@ -56,6 +56,16 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer $this->templating = $templating; } + /** + * Checks if a templating engine has been set. + * + * @return Boolean true if the templating engine has been set, false otherwise + */ + public function hasTemplating() + { + return null !== $this->templating; + } + /** * {@inheritdoc} * From 3e40c176bd2043369779c350f2845f49071fb3d7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 17 Feb 2013 16:59:21 +0100 Subject: [PATCH 04/17] [HttpKernel] fixed locale management when exiting sub-requests This fix is temporary as #7007 will fix it properly in Symfony 2.3. --- .../EventListener/LocaleListener.php | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php b/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php index 529314b86d..f3cb804832 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php @@ -12,7 +12,9 @@ namespace Symfony\Component\HttpKernel\EventListener; use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\RequestContextAwareInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -25,6 +27,7 @@ class LocaleListener implements EventSubscriberInterface { private $router; private $defaultLocale; + private $locales = array(); public function __construct($defaultLocale = 'en', RequestContextAwareInterface $router = null) { @@ -32,19 +35,24 @@ class LocaleListener implements EventSubscriberInterface $this->router = $router; } + public function onKernelResponse(FilterResponseEvent $event) + { + array_shift($this->locales); + + // setting back the locale to the previous value + $locale = isset($this->locales[0]) ? $this->locales[0] : $this->defaultLocale; + $request = $event->getRequest(); + $this->setLocale($request, $locale); + } + public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); $request->setDefaultLocale($this->defaultLocale); + $this->setLocale($request, $request->attributes->get('_locale', $this->defaultLocale)); - if ($locale = $request->attributes->get('_locale')) { - $request->setLocale($locale); - } - - if (null !== $this->router) { - $this->router->getContext()->setParameter('_locale', $request->getLocale()); - } + array_unshift($this->locales, $request->getLocale()); } public static function getSubscribedEvents() @@ -52,6 +60,16 @@ class LocaleListener implements EventSubscriberInterface return array( // must be registered after the Router to have access to the _locale KernelEvents::REQUEST => array(array('onKernelRequest', 16)), + KernelEvents::RESPONSE => 'onKernelResponse', ); } + + private function setLocale(Request $request, $locale) + { + $request->setLocale($locale); + + if (null !== $this->router) { + $this->router->getContext()->setParameter('_locale', $request->getLocale()); + } + } } From 171cff0dc9b3898ecef013cbf0df2957baafc806 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 19 Feb 2013 12:01:40 +0100 Subject: [PATCH 05/17] [FrameworkBundle] Fix a BC for Hinclude global template --- .../FrameworkBundle/DependencyInjection/FrameworkExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 7cff079e82..606677f38b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -365,7 +365,7 @@ class FrameworkExtension extends Extension $container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide); $container->setParameter('templating.helper.form.resources', $config['form']['resources']); - $container->setParameter('templating.hinclude.default_template', $config['hinclude_default_template']); + $container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']); if ($container->getParameter('kernel.debug')) { $loader->load('templating_debug.xml'); From cb0307474e1cf495ee26ac417864d1e7f67245b0 Mon Sep 17 00:00:00 2001 From: Johannes Klauss Date: Tue, 19 Feb 2013 18:21:02 +0100 Subject: [PATCH 06/17] [DomCrawler] lowered parsed protocol string (fixes #6986) --- src/Symfony/Component/DomCrawler/Link.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/DomCrawler/Link.php b/src/Symfony/Component/DomCrawler/Link.php index 1804111f2e..31e8ba12f5 100644 --- a/src/Symfony/Component/DomCrawler/Link.php +++ b/src/Symfony/Component/DomCrawler/Link.php @@ -46,7 +46,7 @@ class Link */ public function __construct(\DOMNode $node, $currentUri, $method = 'GET') { - if (!in_array(substr($currentUri, 0, 4), array('http', 'file'))) { + if (!in_array(strtolower(substr($currentUri, 0, 4)), array('http', 'file'))) { throw new \InvalidArgumentException(sprintf('Current URI must be an absolute URL ("%s").', $currentUri)); } From 069d03051e7fe3b4e8663a83cdd1844ecb7a25d4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 20 Feb 2013 22:48:59 +0100 Subject: [PATCH 07/17] added a note about a BC break for the path info of sub-request (closes #7138) --- src/Symfony/Component/HttpKernel/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md index d6f8886811..fc47662b43 100644 --- a/src/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 2.2.0 ----- + * [BC BREAK] the path info for sub-request is now always _fragment (or whatever you configured instead of the default) * added Symfony\Component\HttpKernel\EventListener\FragmentListener * added Symfony\Component\HttpKernel\UriSigner * added Symfony\Component\HttpKernel\FragmentRenderer and rendering strategies (in Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface) From e7e61fdcc9aa8533630e79701cbf6260ec19530f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 27 Oct 2012 15:29:28 +0200 Subject: [PATCH 08/17] merged branch jfcixmedia/2.1 (PR #5838) This PR was squashed before being merged into the master branch (closes #5838). Commits ------- 201f3e6 [Form] Fixed cannot unset string offsets in CsrfValidationListener Discussion ---------- [Form] Fixed cannot unset string offsets in CsrfValidationListener Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: - Todo: - License of the code: MIT Documentation PR: - A php fatal error is happening when someone rewrite the entire form data for an object with a single input. ``` Fatal error: Cannot unset string offsets in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php on line 72 ``` Example: ```html

``` If someone alters the html to add a simple input at the bottom of the form like this one: ```html ``` The result will be a php fatal error. --------------------------------------------------------------------------- by bschussek at 2012-10-26T09:49:05Z Thank you for the pull request! Could you please reference the pull request in the test? ```php // https://github.com/symfony/symfony/pull/5838 public function testStringFormData() { ... ``` --------------------------------------------------------------------------- by jfcixmedia at 2012-10-26T10:21:29Z @bschussek Added, thanks. --- .../EventListener/CsrfValidationListener.php | 4 +- .../CsrfValidationListenerTest.php | 78 +++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php diff --git a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php index 345a7ea9a9..976312f78f 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php +++ b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php @@ -68,7 +68,9 @@ class CsrfValidationListener implements EventSubscriberInterface $form->addError(new FormError('The CSRF token is invalid. Please try to resubmit the form.')); } - unset($data[$this->fieldName]); + if (is_array($data)) { + unset($data[$this->fieldName]); + } } $event->setData($data); diff --git a/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php new file mode 100644 index 0000000000..65d649ab86 --- /dev/null +++ b/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Csrf\EventListener; + +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\Extension\Csrf\EventListener\CsrfValidationListener; + +class CsrfValidationListenerTest extends \PHPUnit_Framework_TestCase +{ + protected $dispatcher; + protected $factory; + protected $csrfProvider; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->csrfProvider = $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface'); + $this->form = $this->getBuilder('post') + ->setDataMapper($this->getDataMapper()) + ->getForm(); + } + + protected function tearDown() + { + $this->dispatcher = null; + $this->factory = null; + $this->csrfProvider = null; + $this->form = null; + } + + protected function getBuilder($name = 'name') + { + return new FormBuilder($name, null, $this->dispatcher, $this->factory, array('compound' => true)); + } + + protected function getForm($name = 'name') + { + return $this->getBuilder($name)->getForm(); + } + + protected function getDataMapper() + { + return $this->getMock('Symfony\Component\Form\DataMapperInterface'); + } + + protected function getMockForm() + { + return $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + } + + // https://github.com/symfony/symfony/pull/5838 + public function testStringFormData() + { + $data = "XP4HUzmHPi"; + $event = new FormEvent($this->form, $data); + + $validation = new CsrfValidationListener('csrf', $this->csrfProvider, 'unknown'); + $validation->preBind($event); + + // Validate accordingly + $this->assertSame($data, $event->getData()); + } +} From 974768b050df45682d0b481335f67eb2c0fde70e Mon Sep 17 00:00:00 2001 From: Pantelis Sampaziotis Date: Tue, 19 Feb 2013 12:43:38 +0200 Subject: [PATCH 09/17] Added greek translation --- .../Resources/translations/validators.el.xlf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Symfony/Component/Form/Resources/translations/validators.el.xlf diff --git a/src/Symfony/Component/Form/Resources/translations/validators.el.xlf b/src/Symfony/Component/Form/Resources/translations/validators.el.xlf new file mode 100644 index 0000000000..ba2ced74b0 --- /dev/null +++ b/src/Symfony/Component/Form/Resources/translations/validators.el.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Αυτή η φόρμα δεν πρέπει να περιέχει επιπλέον πεδία. + + + The uploaded file was too large. Please try to upload a smaller file. + Το αρχείο είναι πολύ μεγάλο. Παρακαλούμε προσπαθήστε να ανεβάσετε ένα μικρότερο αρχείο. + + + The CSRF token is invalid. Please try to resubmit the form. + Το CSRF token δεν είναι έγκυρο. Παρακαλούμε δοκιμάστε να υποβάλετε τη φόρμα ξανά. + + + + From f8812b28f356078a349dc757be37e8ed5ca2721d Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Thu, 21 Feb 2013 18:06:34 +0100 Subject: [PATCH 10/17] [Form] Fixed "label" option to accept the value "0" --- .../Component/Form/Extension/Core/Type/FieldType.php | 2 +- .../Component/Form/Extension/Core/Type/FieldTypeTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php b/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php index 8b4910805b..2f3d294b79 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php @@ -52,7 +52,7 @@ class FieldType extends AbstractType ->setAttribute('error_mapping', $options['error_mapping']) ->setAttribute('max_length', $options['max_length']) ->setAttribute('pattern', $options['pattern']) - ->setAttribute('label', $options['label'] ?: $this->humanize($builder->getName())) + ->setAttribute('label', strlen($options['label']) > 0 ? $options['label'] : $this->humanize($builder->getName())) ->setAttribute('attr', $options['attr'] ?: array()) ->setAttribute('invalid_message', $options['invalid_message']) ->setAttribute('invalid_message_parameters', $options['invalid_message_parameters']) diff --git a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FieldTypeTest.php b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FieldTypeTest.php index 69a61179bd..0e7e6f32f8 100644 --- a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FieldTypeTest.php +++ b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/FieldTypeTest.php @@ -238,4 +238,12 @@ class FieldTypeTest extends TypeTestCase $form = $this->factory->create('field', null, array('attr' => '')); } + // https://github.com/symfony/symfony/issues/6862 + public function testPassZeroLabelToView() + { + $view = $this->factory->create('field', null, array('label' => 0))->createView(); + + $this->assertEquals('0', $view->get('label')); + } + } From b4b291feb069a276a91b31948d6e1e2052182cdb Mon Sep 17 00:00:00 2001 From: Maks Date: Fri, 22 Feb 2013 06:24:17 +0100 Subject: [PATCH 11/17] Fix docblock type --- src/Symfony/Bridge/Twig/Extension/FormExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Twig/Extension/FormExtension.php b/src/Symfony/Bridge/Twig/Extension/FormExtension.php index fa1aff10cf..0609fb675d 100644 --- a/src/Symfony/Bridge/Twig/Extension/FormExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/FormExtension.php @@ -27,7 +27,7 @@ class FormExtension extends \Twig_Extension * This property is public so that it can be accessed directly from compiled * templates without having to call a getter, which slightly decreases performance. * - * @var \Symfony\Component\Form\FormRendererInterface + * @var TwigRendererInterface */ public $renderer; From 368f62f19c6b32d549ceabba5f786f66944aedc6 Mon Sep 17 00:00:00 2001 From: Eric Caron Date: Thu, 21 Feb 2013 10:53:30 -0600 Subject: [PATCH 12/17] Expanded fault-tolerance for unusual cookie dates --- src/Symfony/Component/BrowserKit/Cookie.php | 7 +++++++ src/Symfony/Component/BrowserKit/Tests/CookieTest.php | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/BrowserKit/Cookie.php b/src/Symfony/Component/BrowserKit/Cookie.php index d4ae77f11d..6e1cdbf3c2 100644 --- a/src/Symfony/Component/BrowserKit/Cookie.php +++ b/src/Symfony/Component/BrowserKit/Cookie.php @@ -30,6 +30,8 @@ class Cookie 'D, d M Y H:i:s T', 'D, d-M-y H:i:s T', 'D, d-M-Y H:i:s T', + 'D, d-m-y H:i:s T', + 'D, d-m-Y H:i:s T', 'D M j G:i:s Y', 'D M d H:i:s Y T', ); @@ -203,6 +205,11 @@ class Cookie } } + // attempt a fallback for unusual formatting + if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) { + return $date->getTimestamp(); + } + throw new \InvalidArgumentException(sprintf('Could not parse date "%s".', $dateValue)); } diff --git a/src/Symfony/Component/BrowserKit/Tests/CookieTest.php b/src/Symfony/Component/BrowserKit/Tests/CookieTest.php index 13e343a901..be53eea417 100644 --- a/src/Symfony/Component/BrowserKit/Tests/CookieTest.php +++ b/src/Symfony/Component/BrowserKit/Tests/CookieTest.php @@ -56,9 +56,12 @@ class CookieTest extends \PHPUnit_Framework_TestCase return array( array('foo=bar; expires=Fri, 31-Jul-2020 08:49:37 GMT'), array('foo=bar; expires=Fri, 31 Jul 2020 08:49:37 GMT'), + array('foo=bar; expires=Fri, 31-07-2020 08:49:37 GMT'), + array('foo=bar; expires=Fri, 31-07-20 08:49:37 GMT'), array('foo=bar; expires=Friday, 31-Jul-20 08:49:37 GMT'), array('foo=bar; expires=Fri Jul 31 08:49:37 2020'), array('foo=bar; expires=\'Fri Jul 31 08:49:37 2020\''), + array('foo=bar; expires=Friday July 31st 2020, 08:49:37 GMT'), ); } @@ -86,7 +89,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase public function testFromStringThrowsAnExceptionIfCookieDateIsNotValid() { $this->setExpectedException('InvalidArgumentException'); - Cookie::FromString('foo=bar; expires=foo'); + Cookie::FromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT'); } public function testFromStringThrowsAnExceptionIfUrlIsNotValid() From 00fbb7ec32943f2869b3b094b3c1700051cd3d14 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Thu, 21 Feb 2013 18:06:34 +0100 Subject: [PATCH 13/17] [Form] Added test for "label" option to accept the value "0" --- .../Form/Tests/Extension/Core/Type/FormTypeTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php index 6fbddeb6a4..274bb912d3 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php @@ -659,4 +659,15 @@ class FormTypeTest extends TypeTestCase $this->assertSame('foo', $view->vars['data']); $this->assertSame('bar', $view->vars['value']); } + + // https://github.com/symfony/symfony/issues/6862 + public function testPassZeroLabelToView() + { + $view = $this->factory->create('form', null, array( + 'label' => '0' + )) + ->createView(); + + $this->assertSame('0', $view->vars['label']); + } } From b7bd630652794805cec788735e459e08787c1895 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Fri, 22 Feb 2013 13:48:44 +0100 Subject: [PATCH 14/17] [Form] Fixed TimeType not to render a "size" attribute in select tags --- .../Resources/views/Form/form_div_layout.html.twig | 3 ++- .../Resources/views/Form/time_widget.html.php | 7 ++++--- .../Component/Form/Tests/AbstractLayoutTest.php | 11 ++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig index 0e562e4142..2aa0bc9967 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig @@ -147,8 +147,9 @@ {% if widget == 'single_text' %} {{ block('form_widget_simple') }} {% else %} + {% set vars = widget == 'text' ? { 'attr': { 'size': 1 }} : {} %}
- {{ form_widget(form.hour, { 'attr': { 'size': '1' } }) }}:{{ form_widget(form.minute, { 'attr': { 'size': '1' } }) }}{% if with_seconds %}:{{ form_widget(form.second, { 'attr': { 'size': '1' } }) }}{% endif %} + {{ form_widget(form.hour, vars) }}:{{ form_widget(form.minute, vars) }}{% if with_seconds %}:{{ form_widget(form.second, vars) }}{% endif %}
{% endif %} {% endspaceless %} diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php index 591bbf797a..42ed19ad5e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php @@ -1,17 +1,18 @@ block($form, 'form_widget_simple'); ?> + array('size' => 1)) : array() ?>
block($form, 'widget_container_attributes') ?>> widget($form['hour'], array('attr' => array('size' => 1))); + echo $view['form']->widget($form['hour'], $vars); echo ':'; - echo $view['form']->widget($form['minute'], array('attr' => array('size' => 1))); + echo $view['form']->widget($form['minute'], $vars); if ($with_seconds) { echo ':'; - echo $view['form']->widget($form['second'], array('attr' => array('size' => 1))); + echo $view['form']->widget($form['second'], $vars); } ?>
diff --git a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php index aa3d46bf2e..8f809103e3 100644 --- a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php @@ -1531,11 +1531,11 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase [ ./select [@id="name_hour"] - [@size="1"] + [not(@size)] [./option[@value="4"][@selected="selected"]] /following-sibling::select [@id="name_minute"] - [@size="1"] + [not(@size)] [./option[@value="5"][@selected="selected"]] ] [count(./select)=2] @@ -1555,17 +1555,17 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase [ ./select [@id="name_hour"] - [@size="1"] + [not(@size)] [./option[@value="4"][@selected="selected"]] [count(./option)>23] /following-sibling::select [@id="name_minute"] - [@size="1"] + [not(@size)] [./option[@value="5"][@selected="selected"]] [count(./option)>59] /following-sibling::select [@id="name_second"] - [@size="1"] + [not(@size)] [./option[@value="6"][@selected="selected"]] [count(./option)>59] ] @@ -1616,6 +1616,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase [@type="time"] [@name="name"] [@value="04:05"] + [not(@size)] ' ); } From f0704aadf388e62ede2a8f58314e806676fb4394 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Fri, 22 Feb 2013 12:08:11 -0500 Subject: [PATCH 15/17] Update composer.json Bump doctrine common dependency for symfony 2.1 users --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 51c21e927a..58cd198336 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=5.3.3", - "doctrine/common": ">2.2,<2.4-dev", + "doctrine/common": ">2.2,<2.5-dev", "twig/twig": ">=1.9.1,<2.0-dev" }, "replace": { From b2080c40e21389f87719f6cbe51b2be716622204 Mon Sep 17 00:00:00 2001 From: Johannes Klauss Date: Fri, 22 Feb 2013 08:28:58 +0100 Subject: [PATCH 16/17] [HttpFoundation] Remove Cache-Control when using https download via IE<9 (fixes #6750) --- .../Component/HttpFoundation/Response.php | 10 +++ .../HttpFoundation/Tests/ResponseTest.php | 69 +++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index cc540356cf..413ae36a40 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -253,6 +253,16 @@ class Response $this->headers->set('expires', -1); } + /** + * Check if we need to remove Cache-Control for ssl encrypted downloads when using IE < 9 + * @link http://support.microsoft.com/kb/323308 + */ + if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) { + if(intval(preg_replace("/(MSIE )(.*?);/", "$2", $match[0])) < 9) { + $this->headers->remove('Cache-Control'); + } + } + return $this; } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index 6ca569c3ea..28b9d53732 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -326,6 +326,75 @@ class ResponseTest extends \PHPUnit_Framework_TestCase $this->assertEquals('text/css; charset=UTF-8', $response->headers->get('Content-Type')); } + public function testNoCacheControlHeaderOnAttachmentUsingHTTPSAndMSIE() + { + // Check for HTTPS and IE 8 + $request = new Request(); + $request->server->set('HTTPS', true); + $request->server->set('HTTP_USER_AGENT', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)'); + + $response = new Response(); + $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); + $response->prepare($request); + + $this->assertFalse($response->headers->has('Cache-Control')); + + // Check for IE 10 and HTTPS + $request->server->set('HTTP_USER_AGENT', 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)'); + + $response = new Response(); + $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); + $response->prepare($request); + + $this->assertTrue($response->headers->has('Cache-Control')); + + // Check for IE 9 and HTTPS + $request->server->set('HTTP_USER_AGENT', 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)'); + + $response = new Response(); + $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); + $response->prepare($request); + + $this->assertTrue($response->headers->has('Cache-Control')); + + // Check for IE 9 and HTTP + $request->server->set('HTTPS', false); + + $response = new Response(); + $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); + $response->prepare($request); + + $this->assertTrue($response->headers->has('Cache-Control')); + + // Check for IE 8 and HTTP + $request->server->set('HTTP_USER_AGENT', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)'); + + $response = new Response(); + $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); + $response->prepare($request); + + $this->assertTrue($response->headers->has('Cache-Control')); + + // Check for non-IE and HTTPS + $request->server->set('HTTPS', true); + $request->server->set('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17'); + + $response = new Response(); + $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); + $response->prepare($request); + + $this->assertTrue($response->headers->has('Cache-Control')); + + // Check for non-IE and HTTP + $request->server->set('HTTPS', false); + + $response = new Response(); + $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); + $response->prepare($request); + + $this->assertTrue($response->headers->has('Cache-Control')); + } + public function testPrepareDoesNothingIfContentTypeIsSet() { $response = new Response('foo'); From 06ebb0db870197eff70ac7811dbd4717642bd2e4 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Fri, 22 Feb 2013 13:53:49 -0500 Subject: [PATCH 17/17] Defined stable version point of Doctrine. --- composer.json | 2 +- src/Symfony/Bundle/FrameworkBundle/composer.json | 2 +- src/Symfony/Component/Routing/composer.json | 4 ++-- src/Symfony/Component/Security/composer.json | 4 ++-- src/Symfony/Component/Validator/composer.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 58cd198336..1d03bf524a 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=5.3.3", - "doctrine/common": ">2.2,<2.5-dev", + "doctrine/common": "~2.2", "twig/twig": ">=1.9.1,<2.0-dev" }, "replace": { diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 75faafe3a0..1e6c560dbe 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -25,7 +25,7 @@ "symfony/routing": "2.1.*", "symfony/templating": "2.1.*", "symfony/translation": "2.1.*", - "doctrine/common": ">=2.2,<2.4-dev" + "doctrine/common": "~2.2" }, "require-dev": { "symfony/finder": "2.1.*" diff --git a/src/Symfony/Component/Routing/composer.json b/src/Symfony/Component/Routing/composer.json index 70f46dac93..dbcaee8343 100644 --- a/src/Symfony/Component/Routing/composer.json +++ b/src/Symfony/Component/Routing/composer.json @@ -22,12 +22,12 @@ "symfony/config": "2.1.*", "symfony/yaml": "2.1.*", "symfony/http-kernel": "2.1.*", - "doctrine/common": ">=2.2,<2.4-dev" + "doctrine/common": "~2.2" }, "suggest": { "symfony/config": "2.1.*", "symfony/yaml": "2.1.*", - "doctrine/common": ">=2.2,<2.4-dev" + "doctrine/common": "~2.2" }, "autoload": { "psr-0": { "Symfony\\Component\\Routing": "" } diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 3240140c17..ecf98c2fb8 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -25,8 +25,8 @@ "symfony/form": "2.1.*", "symfony/routing": "2.1.*", "symfony/validator": "2.1.*", - "doctrine/common": ">=2.2,<2.4-dev", - "doctrine/dbal": ">=2.2,<2.4-dev" + "doctrine/common": "~2.2", + "doctrine/dbal": "~2.2" }, "suggest": { "symfony/class-loader": "2.1.*", diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index 0f4a3ae94f..36a73cbdae 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -24,7 +24,7 @@ "symfony/yaml": "2.1.*" }, "suggest": { - "doctrine/common": ">=2.1,<2.4-dev", + "doctrine/common": "~2.1", "symfony/http-foundation": "2.1.*", "symfony/yaml": "2.1.*" },