diff options
author | David Rothstein <drothstein@gmail.com> | 2015-10-12 20:58:13 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2015-10-12 20:58:13 -0400 |
commit | 792aca6823966f0d464ed05388dbf813d103285d (patch) | |
tree | 0fa2c0cee7911819097a0e4432b412641633e728 /modules | |
parent | 7f638a8c8ffb97af9e6507800788bd182eee2744 (diff) | |
download | brdo-792aca6823966f0d464ed05388dbf813d103285d.tar.gz brdo-792aca6823966f0d464ed05388dbf813d103285d.tar.bz2 |
Issue #2392109 by jacob.embree, sumitmadan, ByronNorris, dcmul, ckaotik, jhedstrom: Filter: Allow plus sign in email addresses
Diffstat (limited to 'modules')
-rw-r--r-- | modules/filter/filter.module | 2 | ||||
-rw-r--r-- | modules/filter/filter.test | 4 |
2 files changed, 4 insertions, 2 deletions
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. ' |