aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-13 18:29:08 -0700
committerMario Vavti <mario@mariovavti.com>2017-06-14 16:56:13 +0200
commitdcbc65a796facf17d2194f0c6a738f43bfe2cc40 (patch)
tree4b8d93656a7eb59f7bfe19c5d654075ee8b4a2f0 /include/text.php
parent8eccd7d47d300f569ddb06d85f1a38441610d61e (diff)
downloadvolse-hubzilla-dcbc65a796facf17d2194f0c6a738f43bfe2cc40.tar.gz
volse-hubzilla-dcbc65a796facf17d2194f0c6a738f43bfe2cc40.tar.bz2
volse-hubzilla-dcbc65a796facf17d2194f0c6a738f43bfe2cc40.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 d8438b2b1..c633ba62a 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1552,13 +1552,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>';
}
}