diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-12-18 12:40:27 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-12-18 12:40:27 +0100 |
commit | 8147ff76a49206a08999f420206d971de10db12e (patch) | |
tree | dea3412c8e30cfab464557bcbe4c5c3fb08bc33e /application/LinkUtils.php | |
parent | 9eba6ff469bdea8f341af06ef23c8bb4bd3a6869 (diff) | |
parent | e3ffc8fdee30be41046b985fe6e7034fb580b0c8 (diff) | |
download | Shaarli-8147ff76a49206a08999f420206d971de10db12e.tar.gz Shaarli-8147ff76a49206a08999f420206d971de10db12e.tar.zst Shaarli-8147ff76a49206a08999f420206d971de10db12e.zip |
merge
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 | } | ||