From 13a50c7f2f40b23a78405d553c5c4de814f4869b Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 28 Sep 2015 17:23:47 +0200 Subject: [PATCH] Don't change $pageData['id'], add ~dup1 to the array key only --- plugins/00-PicoDeprecated.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/00-PicoDeprecated.php b/plugins/00-PicoDeprecated.php index 7058763..1a7b058 100644 --- a/plugins/00-PicoDeprecated.php +++ b/plugins/00-PicoDeprecated.php @@ -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; } }