diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-11-28 18:24:15 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-12-12 03:03:12 +0100 |
commit | d592daea8343bb4dfecff5d97e93699581ccc58c (patch) | |
tree | d508b902b3aba45795fafe16e0b921ac5ea7c4c4 /application/NetscapeBookmarkUtils.php | |
parent | c3dfd8995921083ff7250c25d0b6ab1184b91aff (diff) | |
download | Shaarli-d592daea8343bb4dfecff5d97e93699581ccc58c.tar.gz Shaarli-d592daea8343bb4dfecff5d97e93699581ccc58c.tar.zst Shaarli-d592daea8343bb4dfecff5d97e93699581ccc58c.zip |
Add a persistent 'shorturl' key to all links
All existing link will keep their permalinks.
New links will have smallhash generated with date+id.
The purpose of this is to avoid collision between links due to their creation date.
Diffstat (limited to 'application/NetscapeBookmarkUtils.php')
-rw-r--r-- | application/NetscapeBookmarkUtils.php | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index 8a939adb..e7148d00 100644 --- a/application/NetscapeBookmarkUtils.php +++ b/application/NetscapeBookmarkUtils.php | |||
@@ -174,6 +174,7 @@ class NetscapeBookmarkUtils | |||
174 | $newLinkDate->setTimezone(new DateTimeZone(date_default_timezone_get())); | 174 | $newLinkDate->setTimezone(new DateTimeZone(date_default_timezone_get())); |
175 | $newLink['created'] = $newLinkDate; | 175 | $newLink['created'] = $newLinkDate; |
176 | $newLink['id'] = $linkDb->getNextId(); | 176 | $newLink['id'] = $linkDb->getNextId(); |
177 | $newLink['shorturl'] = link_small_hash($newLink['created'], $newLink['id']); | ||
177 | $linkDb[$newLink['id']] = $newLink; | 178 | $linkDb[$newLink['id']] = $newLink; |
178 | $importCount++; | 179 | $importCount++; |
179 | } | 180 | } |