Don't change $pageData['id'], add ~dup1 to the array key only
This commit is contained in:
parent
a5755b0d39
commit
13a50c7f2f
1 changed files with 4 additions and 3 deletions
|
@ -270,11 +270,12 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
}
|
||||
|
||||
// prevent duplicates
|
||||
for ($i = 1, $origId = $pageData['id']; isset($pages[$pageData['id']]); $i++) {
|
||||
$pageData['id'] = $origId . '~dup' . $i;
|
||||
$id = $pageData['id'];
|
||||
for ($i = 1; isset($pages[$id]); $i++) {
|
||||
$id = $pageData['id'] . '~dup' . $i;
|
||||
}
|
||||
|
||||
$pages[$pageData['id']] = &$pageData;
|
||||
$pages[$id] = &$pageData;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue