summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-10-12 20:58:13 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-10-12 20:58:13 -0400
commit792aca6823966f0d464ed05388dbf813d103285d (patch)
tree0fa2c0cee7911819097a0e4432b412641633e728
parent7f638a8c8ffb97af9e6507800788bd182eee2744 (diff)
downloadbrdo-792aca6823966f0d464ed05388dbf813d103285d.tar.gz
brdo-792aca6823966f0d464ed05388dbf813d103285d.tar.bz2
Issue #2392109 by jacob.embree, sumitmadan, ByronNorris, dcmul, ckaotik, jhedstrom: Filter: Allow plus sign in email addresses
-rw-r--r--CHANGELOG.txt2
-rw-r--r--modules/filter/filter.module2
-rw-r--r--modules/filter/filter.test4
3 files changed, 6 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 064d007d2..c2e0bf389 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,8 @@
Drupal 7.40, xxxx-xx-xx (development version)
-----------------------
+- Fixed the URL text filter to convert e-mail addresses with plus signs into
+ mailto: links.
- Added alternate text to file icons displayed by the File module, to improve
accessibility (string change, and minor API addition to theme_file_icon()).
- Changed one-time login link failure messages to be displayed as errors or
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index edf7aa98b..c710ee700 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -1497,7 +1497,7 @@ function _filter_url($text, $filter) {
$tasks['_filter_url_parse_full_links'] = $pattern;
// Match e-mail addresses.
- $url_pattern = "[A-Za-z0-9._-]{1,254}@(?:$domain)";
+ $url_pattern = "[A-Za-z0-9._+-]{1,254}@(?:$domain)";
$pattern = "`($url_pattern)`";
$tasks['_filter_url_parse_email_links'] = $pattern;
diff --git a/modules/filter/filter.test b/modules/filter/filter.test
index 1565c0c57..d558fa3be 100644
--- a/modules/filter/filter.test
+++ b/modules/filter/filter.test
@@ -1294,6 +1294,7 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
// Create a e-mail that is too long.
$long_email = str_repeat('a', 254) . '@example.com';
$too_long_email = str_repeat('b', 255) . '@example.com';
+ $email_with_plus_sign = 'one+two@example.com';
// Filter selection/pattern matching.
@@ -1307,12 +1308,13 @@ http://example.com or www.example.com
),
// MAILTO URLs.
'
-person@example.com or mailto:person2@example.com or ' . $long_email . ' but not ' . $too_long_email . '
+person@example.com or mailto:person2@example.com or ' . $email_with_plus_sign . ' or ' . $long_email . ' but not ' . $too_long_email . '
' => array(
'<a href="mailto:person@example.com">person@example.com</a>' => TRUE,
'<a href="mailto:person2@example.com">mailto:person2@example.com</a>' => TRUE,
'<a href="mailto:' . $long_email . '">' . $long_email . '</a>' => TRUE,
'<a href="mailto:' . $too_long_email . '">' . $too_long_email . '</a>' => FALSE,
+ '<a href="mailto:' . $email_with_plus_sign . '">' . $email_with_plus_sign . '</a>' => TRUE,
),
// URI parts and special characters.
'