aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkUtils.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-12-12 03:15:32 +0100
committerGitHub <noreply@github.com>2016-12-12 03:15:32 +0100
commit9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a (patch)
tree505cd68f1d07e0b4d6aedcd49c31368760798c62 /application/LinkUtils.php
parenta0d079141eb155c263ebfaa1aad2629382223e31 (diff)
parentd592daea8343bb4dfecff5d97e93699581ccc58c (diff)
downloadShaarli-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.php13
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)
169function format_description($description, $redirector = '', $indexUrl = '') { 169function 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 */
181function link_small_hash($date, $id)
182{
183 return smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id);
184}