Response: Only preserve `showCompact` for explicit redirects

In case of a `__SELF__` redirect, the client should still have
the parameter in the location and its preserved this way then.
This commit is contained in:
Johannes Meyer 2023-10-26 12:05:49 +02:00
parent 30b540952a
commit a2c143d75e
1 changed files with 3 additions and 1 deletions

View File

@ -322,7 +322,9 @@ class Response extends Zend_Controller_Response_Http
if ($request->isXmlHttpRequest()) {
if ($redirectUrl !== null) {
if ($request->isGet() && Icinga::app()->getViewRenderer()->view->compact) {
$redirectUrl->getParams()->set('showCompact', true);
if ($redirectUrl->getParam('redirect') !== '__SELF__') {
$redirectUrl->getParams()->set('showCompact', true);
}
}
$encodedRedirectUrl = rawurlencode($redirectUrl->getAbsoluteUrl());