From 486104d59eb9a82b9fab819f58fee4ce2f78b76a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 29 Aug 2014 09:04:20 +0200 Subject: [PATCH] Check explictly for FALSE when calling onSuccess() This allows us to just end onSuccess() without requiring it to return TRUE to initiate redirection. refs #5525 --- library/Icinga/Web/Form.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index eb8fd7386..b2361701f 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -263,7 +263,7 @@ class Form extends Zend_Form * * @param Request $request The valid request used to process this form * - * @return bool Whether any redirection should take place + * @return null|bool Return FALSE in case no redirect should take place */ public function onSuccess(Request $request) { @@ -403,8 +403,8 @@ class Form extends Zend_Form $formData = $this->getRequestData($request); if ($this->wasSent($formData)) { $this->populate($formData); // Necessary to get isSubmitted() to work - if ($this->isSubmitted() || ! $this->getSubmitLabel()) { - if ($this->isValid($formData) && $this->onSuccess($request)) { + if (! $this->getSubmitLabel() || $this->isSubmitted()) { + if ($this->isValid($formData) && false !== $this->onSuccess($request)) { $this->getResponse()->redirectAndExit($this->getRedirectUrl()); } } else {