summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-10-18 12:17:11 -0700
committerBrion Vibber <brion@pobox.com>2010-10-18 12:17:11 -0700
commit7765ddae81e9b29af06009d961b3d56b293f527c (patch)
tree0878a6c3341683966343af3ceaba682b3526c2de /lib/util.php
parente0cb6d6f7fdda97cb6ed262f79706392e315c055 (diff)
parente04a6ef93ef7706671ba14f5108690bfe12c1592 (diff)
Merge branch '0.9.x' into 1.0.x
Conflicts: README lib/default.php
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index 85d7c72f4..1d7cffe41 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -875,7 +875,8 @@ function common_linkify($url) {
$longurl = $url;
}
}
- $attrs = array('href' => $canon, 'title' => $longurl, 'rel' => 'external');
+
+ $attrs = array('href' => $canon, 'title' => $longurl);
$is_attachment = false;
$attachment_id = null;
@@ -911,6 +912,16 @@ function common_linkify($url) {
$attrs['id'] = "attachment-{$attachment_id}";
}
+ // Whether to nofollow
+
+ $nf = common_config('nofollow', 'external');
+
+ if ($nf == 'never') {
+ $attrs['rel'] = 'external';
+ } else {
+ $attrs['rel'] = 'nofollow external';
+ }
+
return XMLStringer::estring('a', $attrs, $url);
}