From ea496210340dec885a26264fc9117f87cead25a6 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Wed, 2 Mar 2011 15:01:04 +0100 Subject: [PATCH] [Form] Fixed CSRF protection --- src/Symfony/Component/Form/Form.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index b23756d7ef..a4fd061221 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -634,8 +634,10 @@ class Form extends Field implements \IteratorAggregate, FormInterface, FilterInt $token = $provider->generateCsrfToken(get_class($this)); - // FIXME -// $this->add(new HiddenField($fieldName, array('data' => $token))); + $this->add('hidden', $fieldName, array( + 'data' => $token, + 'property_path' => null, + )); } public function disableCsrfProtection()