From 659672ebf9472893629235541d131e20be789008 Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Thu, 30 Jul 2009 00:07:26 -0400
Subject: [PATCH] fix washing of HTML encoded in something other than UTF-8

---
 CHANGELOG               |    1 +
 program/lib/washtml.php |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 4acc977..8c6a5d1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,7 @@
 - Speedup UI by using sprites for (toolbar) buttons
 - Fix charset names with X- prefix handling
 - Fix displaying of HTML messages with unknown/malformed tags (#1486003)
+- Fix HTML washing of non-UTF8 messages
 
 RELEASE 0.3-RC1
 ---------------
diff --git a/program/lib/washtml.php b/program/lib/washtml.php
index efd525d..57145a1 100644
--- a/program/lib/washtml.php
+++ b/program/lib/washtml.php
@@ -246,6 +246,7 @@
     //Charset seems to be ignored (probably if defined in the HTML document)
     $node = new DOMDocument('1.0', $this->config['charset']);
     $this->extlinks = false;
+    $html = mb_convert_encoding($html, 'HTML-ENTITIES', $this->config['charset']);
     @$node->loadHTML($html);
     return $this->dumpHtml($node);
   }

--
Gitblit v1.9.1