aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/LinkUtils.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-03-02 10:54:06 +0100
committerGitHub <noreply@github.com>2019-03-02 10:54:06 +0100
commitcc69aad4a903dc603f47cfa87aeb1865b03c8950 (patch)
treeffc04dac709b2a4cc732ce10f98fb40a562863c7 /application/bookmark/LinkUtils.php
parent5bb384cd2742ff4f982cbe914cee551b74ab4bad (diff)
parenta8e7da01146455f13ef06b151a7dafedd3acf769 (diff)
downloadShaarli-cc69aad4a903dc603f47cfa87aeb1865b03c8950.tar.gz
Shaarli-cc69aad4a903dc603f47cfa87aeb1865b03c8950.tar.zst
Shaarli-cc69aad4a903dc603f47cfa87aeb1865b03c8950.zip
Merge pull request #1271 from ArthurHoaro/hotfix/thumb-note-retrieve
Do not try to retrieve thumbnails for internal link
Diffstat (limited to 'application/bookmark/LinkUtils.php')
-rw-r--r--application/bookmark/LinkUtils.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/application/bookmark/LinkUtils.php b/application/bookmark/LinkUtils.php
index 988970bd..35a5b290 100644
--- a/application/bookmark/LinkUtils.php
+++ b/application/bookmark/LinkUtils.php
@@ -204,3 +204,16 @@ function link_small_hash($date, $id)
204{ 204{
205 return smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id); 205 return smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id);
206} 206}
207
208/**
209 * Returns whether or not the link is an internal note.
210 * Its URL starts by `?` because it's actually a permalink.
211 *
212 * @param string $linkUrl
213 *
214 * @return bool true if internal note, false otherwise.
215 */
216function is_note($linkUrl)
217{
218 return isset($linkUrl[0]) && $linkUrl[0] === '?';
219}