Avoid to set an empty redirect url parameter when accessing icinga web 2

This commit is contained in:
Johannes Meyer 2015-04-15 11:00:47 +02:00
parent d02c078e4a
commit d882ea11b4
1 changed files with 6 additions and 1 deletions

View File

@ -315,13 +315,18 @@ class ActionController extends Zend_Controller_Action
if ($redirect !== null) {
$login->setParam('redirect', '__SELF__');
}
$this->_response->setHttpResponseCode(403);
} elseif ($redirect !== null) {
if (! $redirect instanceof Url) {
$redirect = Url::fromPath($redirect);
}
$login->setParam('redirect', $redirect->getRelativeUrl());
if (($relativeUrl = $redirect->getRelativeUrl())) {
$login->setParam('redirect', $relativeUrl);
}
}
$this->rerenderLayout()->redirectNow($login);
}