From 31dd607fbe094f8ada8cee2c377d77e6526c1398 Mon Sep 17 00:00:00 2001 From: phpnut Date: Wed, 30 May 2007 00:08:25 +0000 Subject: [PATCH] Adding fix for #2657, fixes form with Textarea does not save when Security Component is enabled git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5222 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/form.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 852ec5cd3..bd1ef0168 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -616,8 +616,6 @@ class FormHelper extends AppHelper { * @return string An HTML text input element */ function checkbox($fieldName, $options = array()) { - $this->__secure(); - $value = 1; if(isset($options['value'])) { $value = $options['value']; @@ -625,6 +623,7 @@ class FormHelper extends AppHelper { } $options = $this->__initInputField($fieldName, am(array('type' => 'checkbox'), $options)); + $this->__secure(); $model = $this->model(); if (ClassRegistry::isKeySet($model)) { @@ -656,8 +655,8 @@ class FormHelper extends AppHelper { * @return string An HTML text input element */ function text($fieldName, $options = array()) { - $this->__secure(); $options = $this->__initInputField($fieldName, am(array('type' => 'text'), $options)); + $this->__secure(); return $this->output(sprintf($this->Html->tags['input'], $this->model(), $this->field(), $this->_parseAttributes($options, null, null, ' '))); } /** @@ -668,8 +667,8 @@ class FormHelper extends AppHelper { * @return string */ function password($fieldName, $options = array()) { - $this->__secure(); $options = $this->__initInputField($fieldName, $options); + $this->__secure(); return $this->output(sprintf($this->Html->tags['password'], $this->model(), $this->field(), $this->_parseAttributes($options, null, null, ' '))); } /** @@ -680,8 +679,8 @@ class FormHelper extends AppHelper { * @return string An HTML text input element */ function textarea($fieldName, $options = array()) { - $this->__secure(); $options = $this->__initInputField($fieldName, $options); + $this->__secure(); unset($options['type']); $value = null; @@ -722,8 +721,8 @@ class FormHelper extends AppHelper { * @access public */ function file($fieldName, $options = array()) { - $this->__secure(); $options = $this->__initInputField($fieldName, $options); + $this->__secure(); return $this->output(sprintf($this->Html->tags['file'], $this->model(), $this->field(), $this->_parseAttributes($options, null, '', ' '))); } /**