Skip to content

Commit

Permalink
Fixing form action attributes being double encoded with
Browse files Browse the repository at this point in the history
querystring attributes.
Fixes #1748
  • Loading branch information
markstory committed Jun 23, 2011
1 parent 68378f2 commit d6e262d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -314,7 +314,8 @@ public function create($model = null, $options = array()) {
}
$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) {
Expand Down Expand Up @@ -351,7 +352,7 @@ public function create($model = null, $options = array()) {
}

$this->setEntity($model . '.', true);
return $this->Html->useTag('form', $htmlAttributes) . $append;
return $this->Html->useTag('form', $action, $htmlAttributes) . $append;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -38,7 +38,7 @@ class HtmlHelper extends AppHelper {
'metalink' => '<link href="%s"%s/>',
'link' => '<a href="%s"%s>%s</a>',
'mailto' => '<a href="mailto:%s" %s>%s</a>',
'form' => '<form%s>',
'form' => '<form action="%s"%s>',
'formend' => '</form>',
'input' => '<input name="%s"%s/>',
'textarea' => '<textarea name="%s"%s>%s</textarea>',
Expand Down

0 comments on commit d6e262d

Please sign in to comment.