From 00be9941f37e1281dacfd395ce410f9a69460abc Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 15 Dec 2016 11:18:56 +0100 Subject: [PATCH] Fix a regression: permalinks change when old links are edited fixes #713 --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index cc448352..a0a3a8c7 100644 --- a/index.php +++ b/index.php @@ -1249,10 +1249,12 @@ function renderPage($conf, $pluginManager) // Edit $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); $updated = new DateTime(); + $shortUrl = $LINKSDB[$id]['shorturl']; } else { // New link $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); $updated = null; + $shortUrl = link_small_hash($created, $id); } // Remove multiple spaces. @@ -1279,7 +1281,7 @@ function renderPage($conf, $pluginManager) 'created' => $created, 'updated' => $updated, 'tags' => str_replace(',', ' ', $tags), - 'shorturl' => link_small_hash($created, $id), + 'shorturl' => $shortUrl, ); // If title is empty, use the URL as title. -- 2.41.0