From 220ead44b8c4745b2a3376432d4c32e25c3fd68f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 26 Oct 2023 12:05:49 +0200 Subject: [PATCH] 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. --- library/Icinga/Web/Response.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Response.php b/library/Icinga/Web/Response.php index 182076f92a4..555d3fa8b99 100644 --- a/library/Icinga/Web/Response.php +++ b/library/Icinga/Web/Response.php @@ -322,7 +322,9 @@ protected function prepare() 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());