Index: bbcode.module =================================================================== RCS file: /cvs/drupal/contributions/modules/bbcode/bbcode.module,v retrieving revision 1.44 diff -u -p -r1.44 bbcode.module --- bbcode.module 28 Apr 2007 12:12:03 -0000 1.44 +++ bbcode.module 16 May 2007 13:56:48 -0000 @@ -50,6 +50,13 @@ function bbcode_filter($op, $delta = 0, '#default_value' => variable_get("bbcode_make_links_$format", 1), '#options' => array(t('Disabled'), t('Enabled')), '#description' => t('Turn web and e-mail addresses into clickable links. This is useful if content authors do not explicitly mark addresses as links with [url] and [email] tags.')); + $form['bbcode_filter']["bbcode_filter_nofollow_$format"] = array( + '#type' => 'select', + '#title' => t('Spam link deterrent'), + '#default_value' => variable_get("bbcode_filter_nofollow_$format", 0), + '#options' => array(t('Disabled'), t('Enabled')), + '#description' => t('If enabled, BBCode will add rel="nofollow" to all links, as a measure to reduce the effectiveness of spam links. Note: this will also prevent valid links from being followed by search engines, therefore it is likely most effective when enabled for anonymous users.'), + ); $form['bbcode_filter']["bbcode_encode_mailto_$format"] = array( '#type' => 'select', '#title' => t('Email address encoding'), Index: bbcode-filter.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/bbcode/bbcode-filter.inc,v retrieving revision 1.56 diff -u -p -r1.56 bbcode-filter.inc --- bbcode-filter.inc 29 Apr 2007 07:39:06 -0000 1.56 +++ bbcode-filter.inc 16 May 2007 13:57:44 -0000 @@ -216,6 +216,10 @@ function _bbcode_filter_process(&$body, $body = substr($ret, 1); } + if (variable_get("bbcode_filter_nofollow_$format", 0)) { + $body = preg_replace('#]+)>#i', '', $body); + } + return $body; }