diff options
author | Arthur <arthur@hoa.ro> | 2016-12-12 03:15:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 03:15:32 +0100 |
commit | 9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a (patch) | |
tree | 505cd68f1d07e0b4d6aedcd49c31368760798c62 /application/LinkUtils.php | |
parent | a0d079141eb155c263ebfaa1aad2629382223e31 (diff) | |
parent | d592daea8343bb4dfecff5d97e93699581ccc58c (diff) | |
download | Shaarli-9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a.tar.gz Shaarli-9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a.tar.zst Shaarli-9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a.zip |
Merge pull request #697 from ArthurHoaro/feature/ids-bis
Link ID refactoring
Diffstat (limited to 'application/LinkUtils.php')
-rw-r--r-- | application/LinkUtils.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/application/LinkUtils.php b/application/LinkUtils.php index 9d9ae3cb..cf58f808 100644 --- a/application/LinkUtils.php +++ b/application/LinkUtils.php | |||
@@ -169,3 +169,16 @@ function space2nbsp($text) | |||
169 | function format_description($description, $redirector = '', $indexUrl = '') { | 169 | function format_description($description, $redirector = '', $indexUrl = '') { |
170 | return nl2br(space2nbsp(hashtag_autolink(text2clickable($description, $redirector), $indexUrl))); | 170 | return nl2br(space2nbsp(hashtag_autolink(text2clickable($description, $redirector), $indexUrl))); |
171 | } | 171 | } |
172 | |||
173 | /** | ||
174 | * Generate a small hash for a link. | ||
175 | * | ||
176 | * @param DateTime $date Link creation date. | ||
177 | * @param int $id Link ID. | ||
178 | * | ||
179 | * @return string the small hash generated from link data. | ||
180 | */ | ||
181 | function link_small_hash($date, $id) | ||
182 | { | ||
183 | return smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id); | ||
184 | } | ||