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

This commit is contained in:
AD7six 2011-06-24 10:13:11 +02:00
commit cdd8b615a1
3 changed files with 24 additions and 5 deletions

View file

@ -261,8 +261,6 @@ class Sanitize {
$data = str_replace("\r", "", $data);
}
$data = str_replace("'", "'", str_replace("!", "!", $data));
if ($options['unicode']) {
$data = preg_replace("/&#([0-9]+);/s", "&#\\1;", $data);
}

View file

@ -290,7 +290,7 @@ class FormHelper extends AppHelper {
}
$this->requestType = strtolower($options['type']);
$htmlAttributes['action'] = $this->url($options['action']);
$action = $this->url($options['action']);
unset($options['type'], $options['action']);
if ($options['default'] == false) {
@ -321,7 +321,7 @@ class FormHelper extends AppHelper {
}
$this->setEntity($model . '.', true);
$attributes = $this->_parseAttributes($htmlAttributes, null, '');
$attributes = sprintf('action="%s" ', $action) . $this->_parseAttributes($htmlAttributes, null, '');
return sprintf($this->Html->tags['form'], $attributes) . $append;
}

View file

@ -5829,7 +5829,28 @@ class FormHelperTest extends CakeTestCase {
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
'/div'
);
$this->assertTags($result, $expected, true);
$this->assertTags($result, $expected);
$result = $this->Form->create('Contact', array(
'type' => 'post',
'url' => array(
'controller' => 'controller',
'action' => 'action',
'?' => array('param1' => 'value1', 'param2' => 'value2')
)
));
$expected = array(
'form' => array(
'id' => 'ContactAddForm',
'method' => 'post',
'action' => '/controller/action?param1=value1&param2=value2',
'accept-charset' => $encoding
),
'div' => array('style' => 'display:none;'),
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
'/div'
);
$this->assertTags($result, $expected);
}
/**