mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-13 03:26:48 +01:00
Fix bug in conversion of email addresses to mailto links in plain text messages (#7526)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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...
|
||||
. ")/";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,8 +39,10 @@ class Framework_StringReplacer extends PHPUnit\Framework\TestCase
|
||||
array('https://github.com/a/b/compare/3a0f82...1f4b2a after', '<a href="https://github.com/a/b/compare/3a0f82...1f4b2a">https://github.com/a/b/compare/3a0f82...1f4b2a</a> after'),
|
||||
array('http://<test>', 'http://<test>'),
|
||||
array('http://', 'http://'),
|
||||
array('test@www.test', '<a href="mailto:test@www.test">test@www.test</a>'),
|
||||
array('1@1.com www.domain.tld', '<a href="mailto:1@1.com">1@1.com</a> <a href="http://www.domain.tld">www.domain.tld</a>'),
|
||||
array('test test@www.test test', 'test <a href="mailto:test@www.test">test@www.test</a> test'),
|
||||
array("test 'test@www.test' test", "test '<a href=\"mailto:test@www.test\">test@www.test</a>' test"),
|
||||
array('test "test@www.test" test', 'test "<a href="mailto:test@www.test">test@www.test</a>" test'),
|
||||
array('a 1@1.com www.domain.tld', 'a <a href="mailto:1@1.com">1@1.com</a> <a href="http://www.domain.tld">www.domain.tld</a>'),
|
||||
array(' www.domain.tld ', ' <a href="http://www.domain.tld">www.domain.tld</a> '),
|
||||
array(' www.domain.tld/#!download|856p1|2 ', ' <a href="http://www.domain.tld/#!download|856p1|2">www.domain.tld/#!download|856p1|2</a> '),
|
||||
// #1489898: allow some unicode characters
|
||||
|
||||
Reference in New Issue
Block a user