diff --git a/CHANGELOG b/CHANGELOG index 3b05a94d3..6d4b9a91e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -43,6 +43,7 @@ CHANGELOG Roundcube Webmail - Fix bug where bmp images couldn't be displayed on some systems (#6728) - Fix bug in parsing vCard data using PHP 7.3 due to an invalid regexp (#6744) - Fix bug where bold/strong text was converted to upper-case on html-to-text conversion (6758) +- Fix bug in rcube_utils::parse_hosts() where %t, %d, %z could return only tld (#6746) RELEASE 1.4-rc1 --------------- diff --git a/tests/Framework/Utils.php b/tests/Framework/Utils.php index 9c3857e1f..6728f48c2 100644 --- a/tests/Framework/Utils.php +++ b/tests/Framework/Utils.php @@ -634,4 +634,27 @@ class Framework_Utils extends PHPUnit_Framework_TestCase $this->assertEquals(rcube_utils::idn_to_ascii('H.S'), 'H.S'); $this->assertEquals(rcube_utils::idn_to_ascii('d.-h.lastname'), 'd.-h.lastname'); } + + /** + * Test-Cases for test_parse_host() + */ + function data_parse_host() + { + return array( + array('%z', 'hostname', 'hostname'), + array('%z', 'domain.tld', 'domain.tld'), + array('%z', 'host.domain.tld', 'domain.tld'), + array('%z', 'host1.host2.domain.tld', 'host2.domain.tld'), + ); + } + + /** + * Test parse_host() + * + * @dataProvider data_parse_host + */ + function test_parse_host($name, $host, $result) + { + $this->assertEquals(rcube_utils::parse_host($name, $host), $result); + } }