diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 77b27942e14b90ed33ef24211a507638fc40cc06..b05144361e867cd25b5a20c34bee5c2f6f97363d 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -537,7 +537,7 @@ function _filter_url($text, $filter) { $tasks['_filter_url_parse_full_links'] = $pattern; // Match email addresses. - $url_pattern = "[\p{L}\p{M}\p{N}._-]{1,254}@(?:$domain)"; + $url_pattern = "[\p{L}\p{M}\p{N}._+-]{1,254}@(?:$domain)"; $pattern = "`($url_pattern)`u"; $tasks['_filter_url_parse_email_links'] = $pattern; diff --git a/core/modules/filter/src/Tests/FilterUnitTest.php b/core/modules/filter/src/Tests/FilterUnitTest.php index 8e6c5db2082150307db6263896e9d502e749ea97..b606a4ba28ff26ce8f7e67669467c7debb1bdc74 100644 --- a/core/modules/filter/src/Tests/FilterUnitTest.php +++ b/core/modules/filter/src/Tests/FilterUnitTest.php @@ -515,7 +515,7 @@ function testUrlFilter() { // Create a email 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. $tests = array( @@ -528,12 +528,13 @@ function testUrlFilter() { ), // 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( 'person@example.com' => TRUE, 'mailto:person2@example.com' => TRUE, '' . $long_email . '' => TRUE, '' . $too_long_email . '' => FALSE, + '' . $email_with_plus_sign . '' => TRUE, ), // URI parts and special characters. '