diff --git a/lib/form/sfForm.class.php b/lib/form/sfForm.class.php index 4d206a7d3..20b183904 100644 --- a/lib/form/sfForm.class.php +++ b/lib/form/sfForm.class.php @@ -908,7 +908,7 @@ public function addCSRFProtection($secret = null) $token = $this->getCSRFToken($secret); $this->validatorSchema[self::$CSRFFieldName] = new sfValidatorCSRFToken(array('token' => $token)); - $this->widgetSchema[self::$CSRFFieldName] = new sfWidgetFormInputHidden(); + $this->widgetSchema[self::$CSRFFieldName] = new sfWidgetFormInputHidden(array(), array('value' => $token)); $this->setDefault(self::$CSRFFieldName, $token); return $this;