From a8e7da01146455f13ef06b151a7dafedd3acf769 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 9 Feb 2019 14:13:08 +0100 Subject: Do not try to retrieve thumbnails for internal link Also adds a helper function to determine if a link is a note and apply it across multiple files. --- application/bookmark/LinkUtils.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'application/bookmark/LinkUtils.php') diff --git a/application/bookmark/LinkUtils.php b/application/bookmark/LinkUtils.php index de5b61cb..9e9d4f0a 100644 --- a/application/bookmark/LinkUtils.php +++ b/application/bookmark/LinkUtils.php @@ -220,3 +220,16 @@ function link_small_hash($date, $id) { return smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id); } + +/** + * Returns whether or not the link is an internal note. + * Its URL starts by `?` because it's actually a permalink. + * + * @param string $linkUrl + * + * @return bool true if internal note, false otherwise. + */ +function is_note($linkUrl) +{ + return isset($linkUrl[0]) && $linkUrl[0] === '?'; +} -- cgit v1.2.3