summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-07-15 13:53:22 (GMT)
committerAlex Pott2015-07-15 13:53:52 (GMT)
commitd47bd72b6c44e0096498570509e5b9cb4d4f2d52 (patch)
tree5e42d92615c844f74e97a73dce81adddeaf05f57
parente473fe0340d03060c1c3871ca98c41aeb7a9471d (diff)
Issue #2392109 by jacob.embree, dcmul, ByronNorris, jhedstrom: Filter: Allow plus sign in email addresses
-rw-r--r--core/modules/filter/filter.module2
-rw-r--r--core/modules/filter/src/Tests/FilterUnitTest.php5
2 files changed, 4 insertions, 3 deletions
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 77b2794..b051443 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 8e6c5db..b606a4b 100644
--- a/core/modules/filter/src/Tests/FilterUnitTest.php
+++ b/core/modules/filter/src/Tests/FilterUnitTest.php
@@ -515,7 +515,7 @@ class FilterUnitTest extends KernelTestBase {
// 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 @@ 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.
'