mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
We do not require the request being passed to handleRequest()
refs #5525
This commit is contained in:
parent
5c7999fe9b
commit
45cbd3f067
@ -363,8 +363,12 @@ class Form extends Zend_Form
|
|||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function handleRequest(Request $request)
|
public function handleRequest(Request $request = null)
|
||||||
{
|
{
|
||||||
|
if ($request === null) {
|
||||||
|
$request = $this->getRequest();
|
||||||
|
}
|
||||||
|
|
||||||
if (strtolower($request->getMethod()) === $this->getMethod()) {
|
if (strtolower($request->getMethod()) === $this->getMethod()) {
|
||||||
$formData = $request->{'get' . $request->isPost() ? 'Post' : 'Query'}();
|
$formData = $request->{'get' . $request->isPost() ? 'Post' : 'Query'}();
|
||||||
if ($this->wasSent($formData)) {
|
if ($this->wasSent($formData)) {
|
||||||
@ -502,6 +506,16 @@ class Form extends Zend_Form
|
|||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the current request
|
||||||
|
*
|
||||||
|
* @return Request
|
||||||
|
*/
|
||||||
|
public function getRequest()
|
||||||
|
{
|
||||||
|
return Icinga::app()->getFrontController()->getRequest();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the current Response
|
* Return the current Response
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user