diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php index 22b1a99649e..bcb84c1c844 100755 --- a/src/View/Helper/FormHelper.php +++ b/src/View/Helper/FormHelper.php @@ -1503,7 +1503,7 @@ public function hidden($fieldName, $options = array()) { )); if ($secure === true) { - $this->_secure(true, $options['name'], '' . $options['val']); + $this->_secure(true, $this->_secureFieldName($options), $options['val']); } $options['type'] = 'hidden'; diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php index a77d62a2ee1..77136451aa0 100755 --- a/tests/TestCase/View/Helper/FormHelperTest.php +++ b/tests/TestCase/View/Helper/FormHelperTest.php @@ -1906,11 +1906,13 @@ public function testFormSecuredMultipleSelect() { * @return void */ public function testFormSecuredRadio() { + $this->Form->request->params['_Token'] = 'testKey'; + $this->assertEquals(array(), $this->Form->fields); $options = array('1' => 'option1', '2' => 'option2'); $this->Form->radio('Test.test', $options); - $expected = array('Test[test]' => ''); + $expected = array('Test.test'); $this->assertEquals($expected, $this->Form->fields); } @@ -1920,7 +1922,7 @@ public function testFormSecuredRadio() { * @return void */ public function testFormSecuredAndDisabledNotAssoc() { - $this->Form->request->params['_csrfToken'] = 'testKey'; + $this->Form->request->params['_Token'] = 'testKey'; $this->Form->select('Model.select', array(1, 2), array('disabled')); $this->Form->checkbox('Model.checkbox', array('disabled')); @@ -1942,7 +1944,7 @@ public function testFormSecuredAndDisabledNotAssoc() { * @return void */ public function testFormSecuredAndDisabled() { - $this->Form->request->params['_csrfToken'] = 'testKey'; + $this->Form->request->params['_Token'] = 'testKey'; $this->Form->checkbox('Model.checkbox', array('disabled' => true)); $this->Form->text('Model.text', array('disabled' => true));