Browse Source

Fix empty output from HTML5 parser when content contains XML tag (#7624)

pull/7815/head
Aleksander Machniak 5 years ago
parent
commit
d2bd6b72c1
  1. 3
      CHANGELOG
  2. 3
      program/lib/Roundcube/rcube_washtml.php
  3. 12
      tests/Framework/Washtml.php

3
CHANGELOG

@ -6,10 +6,11 @@ CHANGELOG Roundcube Webmail
- Fix importing birthday dates from Gmail vCards (BDAY:YYYYMMDD)
- Fix restoring Cc/Bcc fields from local storage (#7554)
- Fix jstz.min.js installation, bump version to 1.0.7
- Fix incorrect PDO::lastInsertId() use in sqlsrv driver (#7564)
- Fix link to closure compiler in bin/jsshrink.sh script (#7567)
- Fix bug where some parts of a message could have been missing in a reply/forward body (#7568)
- Fix empty space on mail printouts in Chrome (#7604)
- Fix incorrect PDO::lastInsertId() use in sqlsrv driver (#7564)
- Fix empty output from HTML5 parser when content contains XML tag (#7624)
RELEASE 1.4.8
-------------

3
program/lib/Roundcube/rcube_washtml.php

@ -734,7 +734,8 @@ class rcube_washtml
// washtml/DOMDocument cannot handle xml namespaces
'/<html\s[^>]+>/i',
// washtml/DOMDocument cannot handle xml namespaces
'/<\?xml:namespace\s[^>]+>/i',
// HTML5 parser cannot handler <?xml
'/<\?xml[^>]*>/i',
);
$html_replace = array(

12
tests/Framework/Washtml.php

@ -622,17 +622,23 @@ class Framework_Washtml extends PHPUnit_Framework_TestCase
}
/**
* Test removing xml:namespace tag
* Test removing xml tag
*/
function test_xml_namespace()
function test_xml_tag()
{
$html = '<p><?xml:namespace prefix = "xsl" /></p>';
$washer = new rcube_washtml;
$washed = $this->cleanupResult($washer->wash($html));
$this->assertNotContains('&lt;?xml:namespace"', $washed);
$this->assertSame($washed, '<p></p>');
$html = '<?xml encoding="UTF-8"><html><body>HTML</body></html>';
$washer = new rcube_washtml;
$washed = $this->cleanupResult($washer->wash($html));
$this->assertSame($washed, 'HTML');
}
/**

Loading…
Cancel
Save