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 10 May 2007 14:36:36 -0000 @@ -50,6 +50,12 @@ 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' => 'checkbox', + '#title' => t('Spam link deterrent'), + '#default_value' => variable_get("bbcode_filter_nofollow_$format", FALSE), + '#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 10 May 2007 14:40:36 -0000 @@ -205,6 +205,10 @@ function _bbcode_filter_process(&$body, // comma, double quote or <. $ret = preg_replace('#([\t\r\n >\(\[\|])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\'\(\n\r\t<\)\[\]\|]*)?)#i', '\1\2.\3', $ret); + if (variable_get("bbcode_filter_nofollow_$format", FALSE)) { + $ret = preg_replace('#]+)>#i', '', $ret); + } + // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". if (variable_get("bbcode_encode_mailto_$format", 1))