Commit d47bd72b authored by alexpott's avatar alexpott

Issue #2392109 by jacob.embree, dcmul, ByronNorris, jhedstrom: Filter: Allow...

Issue #2392109 by jacob.embree, dcmul, ByronNorris, jhedstrom: Filter: Allow plus sign in email addresses
parent e473fe03
......@@ -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;
......
......@@ -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(
'<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.
'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment