aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkFilter.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-11-28 18:24:15 +0100
committerArthurHoaro <arthur@hoa.ro>2016-12-12 03:03:12 +0100
commitd592daea8343bb4dfecff5d97e93699581ccc58c (patch)
treed508b902b3aba45795fafe16e0b921ac5ea7c4c4 /application/LinkFilter.php
parentc3dfd8995921083ff7250c25d0b6ab1184b91aff (diff)
downloadShaarli-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/LinkFilter.php')
-rw-r--r--application/LinkFilter.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/application/LinkFilter.php b/application/LinkFilter.php
index 7bab46ba..daa6d9cc 100644
--- a/application/LinkFilter.php
+++ b/application/LinkFilter.php
@@ -120,7 +120,7 @@ class LinkFilter
120 { 120 {
121 $filtered = array(); 121 $filtered = array();
122 foreach ($this->links as $key => $l) { 122 foreach ($this->links as $key => $l) {
123 if ($smallHash == smallHash($l['created']->format('Ymd_His'))) { 123 if ($smallHash == $l['shorturl']) {
124 // Yes, this is ugly and slow 124 // Yes, this is ugly and slow
125 $filtered[$key] = $l; 125 $filtered[$key] = $l;
126 return $filtered; 126 return $filtered;