aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/index.php b/index.php
index 835fd7d2..eb73941d 100644
--- a/index.php
+++ b/index.php
@@ -1245,10 +1245,12 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1245 // Edit 1245 // Edit
1246 $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); 1246 $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
1247 $updated = new DateTime(); 1247 $updated = new DateTime();
1248 $shortUrl = $LINKSDB[$id]['shorturl'];
1248 } else { 1249 } else {
1249 // New link 1250 // New link
1250 $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate); 1251 $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
1251 $updated = null; 1252 $updated = null;
1253 $shortUrl = link_small_hash($created, $id);
1252 } 1254 }
1253 1255
1254 // Remove multiple spaces. 1256 // Remove multiple spaces.
@@ -1275,7 +1277,7 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1275 'created' => $created, 1277 'created' => $created,
1276 'updated' => $updated, 1278 'updated' => $updated,
1277 'tags' => str_replace(',', ' ', $tags), 1279 'tags' => str_replace(',', ' ', $tags),
1278 'shorturl' => link_small_hash($created, $id), 1280 'shorturl' => $shortUrl,
1279 ); 1281 );
1280 1282
1281 // If title is empty, use the URL as title. 1283 // If title is empty, use the URL as title.