`Navigation`: Cast string to int to perform addition

In `library/Icinga/Web/Navigation/Navigation::merge()` the result of `preg_match`
must be cast to int before adding 1 to it.
This commit is contained in:
raviks789 2023-08-15 08:10:19 +02:00
parent fdddc21bc8
commit 4108b6b4cc
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ class Navigation implements ArrayAccess, Countable, IteratorAggregate
$name = $item->getName();
do {
if (preg_match('~_(\d+)$~', $name, $matches)) {
$name = preg_replace('~_\d+$~', $matches[1] + 1, $name);
$name = preg_replace('~_\d+$~', (int) $matches[1] + 1, $name);
} else {
$name .= '_2';
}