diff --git a/drupal/sites/all/features/boinc_standard/boinc_standard.info b/drupal/sites/all/features/boinc_standard/boinc_standard.info
index d5776409ed..b4c33314ba 100644
--- a/drupal/sites/all/features/boinc_standard/boinc_standard.info
+++ b/drupal/sites/all/features/boinc_standard/boinc_standard.info
@@ -179,6 +179,8 @@ features[variable][] = "bbcode_make_links_4"
features[variable][] = "bbcode_make_links_6"
features[variable][] = "bbcode_paragraph_breaks_4"
features[variable][] = "bbcode_paragraph_breaks_6"
+features[variable][] = "bbcode_rewrite_email_4"
+features[variable][] = "bbcode_rewrite_email_6"
features[variable][] = "boinctranslate_filter_debug_4"
features[variable][] = "boinctranslate_filter_nodetypes"
features[variable][] = "comment_anonymous_page"
diff --git a/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc b/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc
index 8594514b8f..3702da46c6 100644
--- a/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc
+++ b/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc
@@ -111,7 +111,9 @@ function boinc_standard_input_formats() {
// Spam link deterrent
'bbcode_filter_nofollow' => '0',
// Email address encoding
- 'bbcode_encode_mailto' => '1',
+ 'bbcode_encode_mailto' => '0',
+ // Email address rewrite
+ 'bbcode_rewrite_email' => '1',
// Smart paragraph and line breaks
'bbcode_paragraph_breaks' => '2',
// Print debugging info
diff --git a/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc b/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc
index 4bb81f0b49..275bc2c1e7 100644
--- a/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc
+++ b/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc
@@ -31,14 +31,14 @@ function boinc_standard_strongarm() {
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'bbcode_encode_mailto_4';
- $strongarm->value = '1';
+ $strongarm->value = '0';
$export['bbcode_encode_mailto_4'] = $strongarm;
$strongarm = new stdClass;
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'bbcode_encode_mailto_6';
- $strongarm->value = '1';
+ $strongarm->value = '0';
$export['bbcode_encode_mailto_6'] = $strongarm;
$strongarm = new stdClass;
@@ -83,6 +83,20 @@ function boinc_standard_strongarm() {
$strongarm->value = '2';
$export['bbcode_paragraph_breaks_6'] = $strongarm;
+ $strongarm = new stdClass;
+ $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
+ $strongarm->api_version = 1;
+ $strongarm->name = 'bbcode_rewrite_email_4';
+ $strongarm->value = '1';
+ $export['bbcode_rewrite_email_4'] = $strongarm;
+
+ $strongarm = new stdClass;
+ $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
+ $strongarm->api_version = 1;
+ $strongarm->name = 'bbcode_rewrite_email_6';
+ $strongarm->value = '1';
+ $export['bbcode_rewrite_email_6'] = $strongarm;
+
$strongarm = new stdClass;
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
diff --git a/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode-filter.inc b/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode-filter.inc
index 16992df8d7..0c1a5a1a8d 100644
--- a/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode-filter.inc
+++ b/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode-filter.inc
@@ -269,6 +269,11 @@ function _bbcode_filter_process(&$body, $format = -1) {
$body);
}
+ // Re-write email addresses
+ if (variable_get("bbcode_rewrite_email_$format", 1)) {
+ $body = preg_replace('#((?<=^|[\t\r\n >\(\[\]\|]))([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i', '\\1\\2-[at]-\\3', $body);
+ }
+
// Turns web and e-mail addresses into clickable links
if (variable_get("bbcode_make_links_$format", 1)) {
@@ -290,10 +295,11 @@ function _bbcode_filter_process(&$body, $format = -1) {
// 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))
- $ret = preg_replace_callback("#([\t\r\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", '_bbcode_encode_mailto', $ret);
- else
- $ret = preg_replace('#([\t\r\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i', '\\1\\2@\\3', $ret);
+ if (variable_get("bbcode_encode_mailto_$format", 1)) {
+ $ret = preg_replace_callback("#((?<=^|[\t\r\n >\(\[\]\|]))([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", '_bbcode_encode_mailto', $ret);
+ } else {
+ $ret = preg_replace('#((?<=^|[\t\r\n >\(\[\]\|]))([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i', '\\1\\2@\\3', $ret);
+ }
// Remove our padding
$ret = str_replace("\x07", '', $ret);
diff --git a/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode.module b/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode.module
index 6f5e76f902..42d54e39ba 100644
--- a/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode.module
+++ b/drupal/sites/default/boinc/modules/contrib/bbcode/bbcode.module
@@ -79,6 +79,13 @@ function bbcode_filter($op, $delta = 0, $format = -1, $text = '') {
'#default_value' => variable_get("bbcode_encode_mailto_$format", 1),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Whether to encode email addresses with javascript. With this method you will have clickable mailto links, but it will be a bit harder for spam robots to collect them.'));
+ $form['bbcode_filter']["bbcode_rewrite_email_$format"] = array(
+ '#type' => 'select',
+ '#title' => t('Email address rewrite'),
+ '#default_value' => variable_get("bbcode_rewrite_email_$format", 1),
+ '#options' => array(t('Disabled'), t('Enabled')),
+ '#description' => t('Whether to rewrite email addresses, replacing the "@" symbol with "-[at]-". This will be a bit harder for spam robots to collect them. If enabled, the "Convert addresses to links" option is ignored. And the "Email address encoding" is ignored.'),
+ );
$form['bbcode_filter']["bbcode_paragraph_breaks_$format"] = array(
'#type' => 'select',
'#title' => t('Smart paragraph and line breaks'),