]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge pull request #666 from ArthurHoaro/slim-api
[github/shaarli/Shaarli.git] / index.php
index 835fd7d29b60370bbb7c5683a23022dbfb1f8074..eb73941deded389a6521264cf9112358e71543fb 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1245,10 +1245,12 @@ function renderPage($conf, $pluginManager, $LINKSDB)
             // 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.
@@ -1275,7 +1277,7 @@ function renderPage($conf, $pluginManager, $LINKSDB)
             '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.