X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fbookmark%2FLinkUtils.php;h=35a5b290454b32870464c6457fea73059d613f4c;hb=cc69aad4a903dc603f47cfa87aeb1865b03c8950;hp=988970bdf924854ba06fa352a61a1d3c62da94bd;hpb=5bb384cd2742ff4f982cbe914cee551b74ab4bad;p=github%2Fshaarli%2FShaarli.git 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) { 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] === '?'; +}