1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Description: /setup/: ensure not to pass an empty array to max()
as PHP 8 doesn't tolerate such.
Author: "Alexander A. Klimov" <alexander.klimov@icinga.com>
Origin: https://github.com/Icinga/icingaweb2/pull/4289/commits/19172a84bc5659114bf8618059e3c5e4ad191916
Bug: https://github.com/Icinga/icingaweb2/issues/4287
Bug-Debian: https://bugs.debian.org/977337
--- a/modules/setup/application/views/scripts/index/index.phtml
+++ b/modules/setup/application/views/scripts/index/index.phtml
@@ -9,10 +9,10 @@ $currentPos = array_search($wizard->getC
list($configPagesLeft, $configPagesRight) = array_chunk($configPages, count($configPages) / 2, true);
$visitedPages = array_keys($wizard->getPageData());
-$maxProgress = @max(array_keys(array_filter(
+$maxProgress = @max(array_merge([0], array_keys(array_filter(
$pages,
function ($page) use ($visitedPages) { return in_array($page->getName(), $visitedPages); }
-)));
+))));
?>
<div id="setup-content-wrapper" data-base-target="layout">
|