From a0374f3c45578b8b51ff1850c00f4f0732e17193 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 8 Nov 2017 12:38:19 +0100 Subject: [PATCH] Fix mangled non-ASCII characters in links in HTML messages (#6028) --- CHANGELOG | 1 + program/lib/Roundcube/html.php | 5 ++++- tests/Framework/Html.php | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index c6637e47c..2d7f74bd9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -53,6 +53,7 @@ CHANGELOG Roundcube Webmail - Fix decoding of mailto: links with + character in HTML messages (#6020) - Fix false reporting of failed upgrade in installto.sh (#6019) - Fix file disclosure vulnerability caused by insuficient input validation in relation to attachment plugins (#6026) +- Fix mangled non-ASCII characters in links in HTML messages (#6028) RELEASE 1.3.2 ------------- diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php index ffb049301..eea6a2f04 100644 --- a/program/lib/Roundcube/html.php +++ b/program/lib/Roundcube/html.php @@ -349,7 +349,10 @@ class html public static function parse_attrib_string($str) { $attrib = array(); - $html = '
'; + $html = '' + . '' + . '
' + . ''; $document = new DOMDocument('1.0', RCUBE_CHARSET); @$document->loadHTML($html); diff --git a/tests/Framework/Html.php b/tests/Framework/Html.php index edc3466b0..8507477c2 100644 --- a/tests/Framework/Html.php +++ b/tests/Framework/Html.php @@ -117,6 +117,10 @@ class Framework_Html extends PHPUnit_Framework_TestCase 'expression="test == true ? \' test\' : \'\'" ', array('expression' => 'test == true ? \' test\' : \'\''), ), + array( + 'href="http://domain.tld/страница"', + array('href' => 'http://domain.tld/страница'), + ), ); }