diff --git a/CHANGELOG b/CHANGELOG index 99ec4d3b3..a887f1983 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -47,6 +47,7 @@ CHANGELOG Roundcube Webmail - Elastic: Fix redundant scrollbar in plain text editor on mail reply (#7500) - Elastic: Fix deleted and replied+forwarded icons on messages list (#7503) - Managesieve: Allow angle brackets in out-of-office message body (#7518) +- Fix bug in conversion of email addresses to mailto links in plain text messages (#7526) - Fix format=flowed formatting on plain text part derived from the HTML content (#7504) - Fix incorrect rewriting of internal links in HTML content (#7512) - Fix handling links without defined protocol (#7454) diff --git a/program/lib/Roundcube/rcube_string_replacer.php b/program/lib/Roundcube/rcube_string_replacer.php index cad259617..34a8a94ac 100644 --- a/program/lib/Roundcube/rcube_string_replacer.php +++ b/program/lib/Roundcube/rcube_string_replacer.php @@ -59,10 +59,10 @@ class rcube_string_replacer $this->linkref_pattern = '/\[([^\]#]+)\]/'; $this->link_pattern = "/$link_prefix($utf_domain([$url1]*[$url2]+)*)/"; $this->mailto_pattern = "/(" - ."[-\w!\#\$%&\'*+~\/^`|{}=]+(?:\.[-\w!\#\$%&\'*+~\/^`|{}=]+)*" // local-part - ."@$utf_domain" // domain-part - ."(\?[$url1$url2]+)?" // e.g. ?subject=test... - .")/"; + . "[-\w!\#\$%&*+~\/^`|{}=]+(?:\.[-\w!\#\$%&*+~\/^`|{}=]+)*" // local-part + . "@$utf_domain" // domain-part + . "(\?[$url1$url2]+)?" // e.g. ?subject=test... + . ")/"; } /** diff --git a/tests/Framework/StringReplacer.php b/tests/Framework/StringReplacer.php index 6adaee4ce..07649bd01 100644 --- a/tests/Framework/StringReplacer.php +++ b/tests/Framework/StringReplacer.php @@ -39,8 +39,10 @@ class Framework_StringReplacer extends PHPUnit\Framework\TestCase array('https://github.com/a/b/compare/3a0f82...1f4b2a after', 'https://github.com/a/b/compare/3a0f82...1f4b2a after'), array('http://', 'http://'), array('http://', 'http://'), - array('test@www.test', 'test@www.test'), - array('1@1.com www.domain.tld', '1@1.com www.domain.tld'), + array('test test@www.test test', 'test test@www.test test'), + array("test 'test@www.test' test", "test 'test@www.test' test"), + array('test "test@www.test" test', 'test "test@www.test" test'), + array('a 1@1.com www.domain.tld', 'a 1@1.com www.domain.tld'), array(' www.domain.tld ', ' www.domain.tld '), array(' www.domain.tld/#!download|856p1|2 ', ' www.domain.tld/#!download|856p1|2 '), // #1489898: allow some unicode characters