Skip to content

Commit f4f53bb

Browse files
David Bakertburry
David Baker
authored andcommitted
An option to allow plugins control over the rel="nofollow" attribute on links within forum messages.
1 parent 3bfb786 commit f4f53bb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

plugins/HtmLawed/class.htmlawed.plugin.php

+13
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ public function Format($Html) {
4747
'schemes' => 'classid:clsid; href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; style: nil; *:file, http, https', // clsid allowed in class
4848
'valid_xml' => 2
4949
);
50+
// We check the flag within Gdn_Format to see
51+
// if htmLawed should place rel="nofollow" links
52+
// within output or not.
53+
// A plugin can set this flag (for example).
54+
// The default is to show rel="nofollow" on all links.
55+
if(Gdn_Format::$DisplayNoFollow){
56+
// display rel="nofollow" on all links.
57+
$Config['anti_link_spam'] = array('`.`', '');
58+
}else{
59+
// never display rel="nofollow"
60+
$Config['anti_link_spam'] = array('','');
61+
}
62+
5063

5164
if ($this->SafeStyles) {
5265
// Deny all class and style attributes.

0 commit comments

Comments
 (0)