Fix a regression: permalinks change when old links are edited
fixes #713
This commit is contained in:
parent
3cc8c89830
commit
00be9941f3
1 changed files with 3 additions and 1 deletions
|
@ -1249,10 +1249,12 @@ function renderPage($conf, $pluginManager)
|
||||||
// Edit
|
// Edit
|
||||||
$created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
|
$created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
|
||||||
$updated = new DateTime();
|
$updated = new DateTime();
|
||||||
|
$shortUrl = $LINKSDB[$id]['shorturl'];
|
||||||
} else {
|
} else {
|
||||||
// New link
|
// New link
|
||||||
$created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
|
$created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
|
||||||
$updated = null;
|
$updated = null;
|
||||||
|
$shortUrl = link_small_hash($created, $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove multiple spaces.
|
// Remove multiple spaces.
|
||||||
|
@ -1279,7 +1281,7 @@ function renderPage($conf, $pluginManager)
|
||||||
'created' => $created,
|
'created' => $created,
|
||||||
'updated' => $updated,
|
'updated' => $updated,
|
||||||
'tags' => str_replace(',', ' ', $tags),
|
'tags' => str_replace(',', ' ', $tags),
|
||||||
'shorturl' => link_small_hash($created, $id),
|
'shorturl' => $shortUrl,
|
||||||
);
|
);
|
||||||
|
|
||||||
// If title is empty, use the URL as title.
|
// If title is empty, use the URL as title.
|
||||||
|
|
Loading…
Reference in a new issue