Fix mangled non-ASCII characters in links in HTML messages (#6028)

pull/6072/head
Aleksander Machniak 7 years ago
parent 3b439ec920
commit 46faac4a6e

@ -4,6 +4,7 @@ CHANGELOG Roundcube Webmail
- Fix decoding of mailto: links with + character in HTML messages (#6020) - Fix decoding of mailto: links with + character in HTML messages (#6020)
- Fix false reporting of failed upgrade in installto.sh (#6019) - 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 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 RELEASE 1.3.2
------------- -------------

@ -349,7 +349,10 @@ class html
public static function parse_attrib_string($str) public static function parse_attrib_string($str)
{ {
$attrib = array(); $attrib = array();
$html = '<html><body><div ' . rtrim($str, '/ ') . ' /></body></html>'; $html = '<html>'
. '<head><meta http-equiv="Content-Type" content="text/html; charset=' . RCUBE_CHARSET . '" /></head>'
. '<body><div ' . rtrim($str, '/ ') . ' /></body>'
. '</html>';
$document = new DOMDocument('1.0', RCUBE_CHARSET); $document = new DOMDocument('1.0', RCUBE_CHARSET);
@$document->loadHTML($html); @$document->loadHTML($html);

@ -117,6 +117,10 @@ class Framework_Html extends PHPUnit_Framework_TestCase
'expression="test == true ? \' test\' : \'\'" ', 'expression="test == true ? \' test\' : \'\'" ',
array('expression' => 'test == true ? \' test\' : \'\''), array('expression' => 'test == true ? \' test\' : \'\''),
), ),
array(
'href="http://domain.tld/страница"',
array('href' => 'http://domain.tld/страница'),
),
); );
} }

Loading…
Cancel
Save