From 8b5038befcccc29bdf8ea1f0f5745277e87e072f Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 29 Sep 2014 05:22:38 -0400
Subject: [PATCH] Fix handling of smart list inputs

---
 program/lib/Roundcube/rcube_html2text.php |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/program/lib/Roundcube/rcube_html2text.php b/program/lib/Roundcube/rcube_html2text.php
index 3b4508d..499c4b0 100644
--- a/program/lib/Roundcube/rcube_html2text.php
+++ b/program/lib/Roundcube/rcube_html2text.php
@@ -423,7 +423,7 @@
         // Variables used for building the link list
         $this->_link_list = array();
 
-        $text = trim(stripslashes($this->html));
+        $text = $this->html;
 
         // Convert HTML to TXT
         $this->_converter($text);
@@ -473,6 +473,9 @@
         // Replace known html entities
         $text = html_entity_decode($text, ENT_QUOTES, $this->charset);
 
+        // Replace unicode nbsp to regular spaces
+        $text = preg_replace('/\xC2\xA0/', ' ', $text);
+
         // Remove unknown/unhandled entities (this cannot be done in search-and-replace block)
         $text = preg_replace('/&([a-zA-Z0-9]{2,6}|#[0-9]{2,4});/', '', $text);
 

--
Gitblit v1.9.1