Form: Do not encode actions twice

This commit is contained in:
Johannes Meyer 2015-06-24 16:15:45 +02:00
parent 8448f4ade4
commit ebe144c16a
2 changed files with 19 additions and 2 deletions

View File

@ -1086,6 +1086,24 @@ class Form extends Zend_Form
return $name;
}
/**
* Set the action to submit this form against
*
* Note that if you'll pass a instance of URL, Url::getAbsoluteUrl('&') is called to set the action.
*
* @param Url|string $action
*
* @return $this
*/
public function setAction($action)
{
if ($action instanceof Url) {
$action = $action->getAbsoluteUrl('&');
}
return parent::setAction($action);
}
/**
* Set form description
*

View File

@ -200,8 +200,7 @@
var icinga = self.icinga;
// .closest is not required unless subelements to trigger this
var $form = $(event.currentTarget).closest('form');
var regex = new RegExp('&', 'g');
var url = $form.attr('action').replace(regex, '&'); // WHY??
var url = $form.attr('action');
var method = $form.attr('method');
var $button = $('input[type=submit]:focus', $form).add('button[type=submit]:focus', $form);
var $target;