summaryrefslogtreecommitdiffstatshomepage
path: root/data/templates/sscuttlizr/bookmarks.tpl.php
diff options
context:
space:
mode:
authorGravatar Tom Willemse2024-04-21 00:28:16 -0700
committerGravatar Tom Willemse2024-04-21 00:28:16 -0700
commitb5e0e85f5d325664bd1b3d6d1bd17efa50017644 (patch)
treeee1aecb37ca8d5f8ec9cf461c79b00890d4c26d3 /data/templates/sscuttlizr/bookmarks.tpl.php
parentab2657e35190f8c1d8e495cf167ce6c48f91d8cb (diff)
downloadscuttle-b5e0e85f5d325664bd1b3d6d1bd17efa50017644.tar.gz
scuttle-b5e0e85f5d325664bd1b3d6d1bd17efa50017644.zip
feat: Add options to include noreferrer and noopener in links
- ‘noreferrer’ prevents the Referer header from being sent to the server the link points at when the link is clicked on. - ‘noopener’ prevents the ‘window.opener’ property from being set when the link is clicked on.
Diffstat (limited to 'data/templates/sscuttlizr/bookmarks.tpl.php')
-rw-r--r--data/templates/sscuttlizr/bookmarks.tpl.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/data/templates/sscuttlizr/bookmarks.tpl.php b/data/templates/sscuttlizr/bookmarks.tpl.php
index 1510d44..41b5975 100644
--- a/data/templates/sscuttlizr/bookmarks.tpl.php
+++ b/data/templates/sscuttlizr/bookmarks.tpl.php
@@ -415,8 +415,14 @@ if ($currenttag!= '') {
// Nofollow option
$rel = '';
if ($GLOBALS['nofollow']) {
- $rel = ' rel="nofollow"';
+ $rel .= ' nofollow ';
}
+ if ($GLOBALS['noreferrer']) {
+ $rel .= ' noreferrer ';
+ }
+ if ($GLOBALS['noopener']) {
+ $rel .= ' noopener ';
+ }
$address = $row['bAddress'];
$oaddress = $address;
@@ -465,7 +471,9 @@ if ($currenttag!= '') {
echo ' <div' . $adminBgClass . '>' . "\n";
echo ' <div class="link">'
- . '<a href="'. htmlspecialchars($address) .'"'. $rel .' class="taggedlink">'
+ . ('<a href="' . htmlspecialchars($address) . '"'
+ . ($rel ? ' rel="' . trim($rel) . '"' : "")
+ . ' class="taggedlink">')
. filter($row['bTitle'])
. '</a>' . $adminStar . "</div>\n";
if ($row['bDescription'] == '') {