From d66793f0af519ff68a1f785ed65e686a1341a79a Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 09 Feb 2016 05:39:55 -0500
Subject: [PATCH] Fix missing emoticons on html-to-text conversion

---
 CHANGELOG                  |    2 +-
 program/include/rcmail.php |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 84dc97b..7aefac7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
-
+- Fix missing emoticons on html-to-text conversion
 - Fix random "access to this resource is secured against CSRF" message at logout (#1490641)
 - Fix missing language name in "Add to Dictionary" request in HTML mode (#1490634)
 - Enable use of TLSv1.1 and TLSv1.2 for IMAP (#1490640)
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 918be18..95ad67a 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1926,7 +1926,8 @@
 
         foreach ($emoticons as $idx => $file) {
             // <img title="Cry" src="http://.../program/js/tinymce/plugins/emoticons/img/smiley-cry.gif" border="0" alt="Cry" />
-            $search[]  = '/<img title="[a-z ]+" src="https?:\/\/[a-z0-9_.\/-]+\/tinymce\/plugins\/emoticons\/img\/'.$file.'.gif"[^>]+\/>/i';
+            $file      = preg_quote('program/js/tinymce/plugins/emoticons/img/' . $file . '.gif', '/');
+            $search[]  = '/<img (title="[a-z ]+" )?src="[^"]+' . $file . '"[^>]+\/>/i';
             $replace[] = $idx;
         }
 

--
Gitblit v1.9.1