diff --git a/CHANGELOG b/CHANGELOG index 5a5dd71d8b8..34b83175f2d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ CHANGELOG Roundcube Webmail - Fix bug where pink image was used instead of a thumbnail when image resize fails (#5933) - Fix so files size/count limit is verified (client-side) also on drag-n-drop uploads (#5940) - Fix invalid template loading on a message error in preview frame (#5941) +- Fix bug where HTML messages could have been rendered empty on some systems (#5957) RELEASE 1.3.1 ------------- diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php index 4375bcc4cd1..0880764a000 100644 --- a/program/lib/Roundcube/rcube_washtml.php +++ b/program/lib/Roundcube/rcube_washtml.php @@ -311,17 +311,17 @@ private function wash_attribs($node) } } - if ($this->is_image_attribute($node->tagName, $key)) { + if ($this->is_image_attribute($node->nodeName, $key)) { $out = $this->wash_uri($value, true); } - else if ($this->is_link_attribute($node->tagName, $key)) { + else if ($this->is_link_attribute($node->nodeName, $key)) { if (!preg_match('!^(javascript|vbscript|data:text)!i', $value) && preg_match('!^([a-z][a-z0-9.+-]+:|//|#).+!i', $value) ) { $out = $value; } } - else if ($this->is_funciri_attribute($node->tagName, $key)) { + else if ($this->is_funciri_attribute($node->nodeName, $key)) { if (preg_match('/^[a-z:]*url\(/i', $val)) { if (preg_match('/^([a-z:]*url)\(\s*[\'"]?([^\'"\)]*)[\'"]?\s*\)/iu', $value, $match)) { if ($url = $this->wash_uri($match[2])) { @@ -454,14 +454,14 @@ private function dumpHtml($node, $level = 20) do { switch ($node->nodeType) { case XML_ELEMENT_NODE: //Check element - $tagName = strtolower($node->tagName); + $tagName = strtolower($node->nodeName); if ($callback = $this->handlers[$tagName]) { $dump .= call_user_func($callback, $tagName, $this->wash_attribs($node), $this->dumpHtml($node, $level), $this); } else if (isset($this->_html_elements[$tagName])) { $content = $this->dumpHtml($node, $level); - $dump .= '<' . $node->tagName; + $dump .= '<' . $node->nodeName; if ($tagName == 'svg') { $xpath = new DOMXPath($node->ownerDocument); @@ -481,14 +481,14 @@ private function dumpHtml($node, $level = 20) $dump .= ' />'; } else { - $dump .= '>' . $content . 'tagName . '>'; + $dump .= '>' . $content . 'nodeName . '>'; } } else if (isset($this->_ignore_elements[$tagName])) { - $dump .= ''; + $dump .= ''; } else { - $dump .= ''; + $dump .= ''; $dump .= $this->dumpHtml($node, $level); // ignore tags not its content } break;