diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 9f42cde1d..86a70fafc 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -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); } diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 79a867738..93067a432 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -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; } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index a8d4caa64..07667e7ec 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -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); } /**