diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-12-15 11:18:56 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-12-15 11:43:42 +0100 |
commit | 00be9941f37e1281dacfd395ce410f9a69460abc (patch) | |
tree | ea6cccff1396fe49670bf8ba7252ad1798b9a7e2 /index.php | |
parent | 3cc8c898307ad53507a128db2b11238be2641c32 (diff) | |
download | Shaarli-00be9941f37e1281dacfd395ce410f9a69460abc.tar.gz Shaarli-00be9941f37e1281dacfd395ce410f9a69460abc.tar.zst Shaarli-00be9941f37e1281dacfd395ce410f9a69460abc.zip |
Fix a regression: permalinks change when old links are edited
fixes #713
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1249,10 +1249,12 @@ function renderPage($conf, $pluginManager) | |||
1249 | // Edit | 1249 | // Edit |
1250 | $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); | 1250 | $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); |
1251 | $updated = new DateTime(); | 1251 | $updated = new DateTime(); |
1252 | $shortUrl = $LINKSDB[$id]['shorturl']; | ||
1252 | } else { | 1253 | } else { |
1253 | // New link | 1254 | // New link |
1254 | $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); | 1255 | $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); |
1255 | $updated = null; | 1256 | $updated = null; |
1257 | $shortUrl = link_small_hash($created, $id); | ||
1256 | } | 1258 | } |
1257 | 1259 | ||
1258 | // Remove multiple spaces. | 1260 | // Remove multiple spaces. |
@@ -1279,7 +1281,7 @@ function renderPage($conf, $pluginManager) | |||
1279 | 'created' => $created, | 1281 | 'created' => $created, |
1280 | 'updated' => $updated, | 1282 | 'updated' => $updated, |
1281 | 'tags' => str_replace(',', ' ', $tags), | 1283 | 'tags' => str_replace(',', ' ', $tags), |
1282 | 'shorturl' => link_small_hash($created, $id), | 1284 | 'shorturl' => $shortUrl, |
1283 | ); | 1285 | ); |
1284 | 1286 | ||
1285 | // If title is empty, use the URL as title. | 1287 | // If title is empty, use the URL as title. |