mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 17:24:16 +02:00
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:
parent
fdddc21bc8
commit
4108b6b4cc
@ -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';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user