Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '1.3' of github.com:cakephp/cakephp1x into 1.3

  • Loading branch information...
commit 94391d71c295a8ddf171120d0020f5db0f95324b 2 parents 9d3a2c6 + 7eb3055
@markstory markstory authored
View
9 cake/libs/view/helpers/form.php
@@ -1412,6 +1412,9 @@ function select($fieldName, $options = array(), $selected = null, $attributes =
$escapeOptions = $attributes['escape'];
unset($attributes['escape']);
}
+ if (isset($attributes['secure'])) {
+ $secure = $attributes['secure'];
+ }
if (isset($attributes['empty'])) {
$showEmpty = $attributes['empty'];
unset($attributes['empty']);
@@ -1452,7 +1455,9 @@ function select($fieldName, $options = array(), $selected = null, $attributes =
}
if (!empty($tag) || isset($template)) {
- $this->__secure();
+ if (!isset($secure) || $secure == true) {
+ $this->__secure();
+ }
$select[] = sprintf($tag, $attributes['name'], $this->_parseAttributes(
$attributes, array('name', 'value'))
);
@@ -2169,4 +2174,4 @@ function _initInputField($field, $options = array()) {
}
}
-?>
+?>
View
27 cake/tests/cases/libs/view/helpers/form.test.php
@@ -1225,6 +1225,31 @@ function testFormSecuredRadio() {
}
/**
+ * testDisableSecurityUsingForm method
+ *
+ * @access public
+ * @return void
+ */
+ function testDisableSecurityUsingForm() {
+ $this->Form->params['_Token']['key'] = 'testKey';
+ $this->Form->params['_Token']['disabledFields'] = array();
+ $this->Form->create();
+
+ $this->Form->hidden('Addresses.id', array('value' => '123456'));
+ $this->Form->input('Addresses.title');
+ $this->Form->input('Addresses.first_name', array('secure' => false));
+ $this->Form->input('Addresses.city', array('type' => 'textarea', 'secure' => false));
+ $this->Form->input('Addresses.zip', array(
+ 'type' => 'select', 'options' => array(1,2), 'secure' => false
+ ));
+
+ $result = $this->Form->fields;
+ $expected = array(
+ 'Addresses.id' => '123456', 'Addresses.title',
+ );
+ $this->assertEqual($result, $expected);
+ }
+/**
* testPasswordValidation method
*
* test validation errors on password input.
@@ -6173,4 +6198,4 @@ function testInputTemplate() {
$this->assertTags($result, $expected);
}
}
-?>
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.