aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-13 18:29:08 -0700
committerzotlabs <mike@macgirvin.com>2017-06-13 18:29:08 -0700
commitfce68f1a39c73246ad449aee1bf7a4b9aba9837f (patch)
tree71507de564c22d24244846e3b367c78d59e4b5cc /include/text.php
parent7f374fe69f46c041221736e4940b1cb0e8809fd1 (diff)
downloadvolse-hubzilla-fce68f1a39c73246ad449aee1bf7a4b9aba9837f.tar.gz
volse-hubzilla-fce68f1a39c73246ad449aee1bf7a4b9aba9837f.tar.bz2
volse-hubzilla-fce68f1a39c73246ad449aee1bf7a4b9aba9837f.zip
add rel=noopener to all external target _blank links
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index c791b50ee..5af4f1b67 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1531,13 +1531,13 @@ function prepare_body(&$item,$attach = false) {
// if original photo width is <= 640px prepend it to item body
if($object['link'][0]['width'] && $object['link'][0]['width'] <= 640) {
- $s .= '<div class="inline-photo-item-wrapper"><a href="' . zid(rawurldecode($object['id'])) . '" target="_blank"><img class="inline-photo-item" style="max-width:' . $object['link'][0]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][0]['href'])) . '"></a></div>' . $s;
+ $s .= '<div class="inline-photo-item-wrapper"><a href="' . zid(rawurldecode($object['id'])) . '" target="_blank" rel="nofollow noopener" ><img class="inline-photo-item" style="max-width:' . $object['link'][0]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][0]['href'])) . '"></a></div>' . $s;
}
// if original photo width is > 640px make it a cover photo
if($object['link'][0]['width'] && $object['link'][0]['width'] > 640) {
$scale = ((($object['link'][1]['width'] == 1024) || ($object['link'][1]['height'] == 1024)) ? 1 : 0);
- $photo = '<a href="' . zid(rawurldecode($object['id'])) . '" target="_blank"><img style="max-width:' . $object['link'][$scale]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][$scale]['href'])) . '"></a>';
+ $photo = '<a href="' . zid(rawurldecode($object['id'])) . '" target="_blank" rel="nofollow noopener"><img style="max-width:' . $object['link'][$scale]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][$scale]['href'])) . '"></a>';
}
}