From 9fe1cf16b3d0f496291126f12a854345ac76831f Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 21 Jul 2016 16:47:47 +0200 Subject: [PATCH] Fix handling of blockquote tags with mixed case on html2text conversion (#5363) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_html2text.php | 6 +++--- tests/Framework/Html2text.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b5e9982c0..3db6289d2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -27,6 +27,7 @@ CHANGELOG Roundcube Webmail - Use contact_search_name format in popup on results in compose contacts search - Fix handling of 'mailto' and 'error' arguments in message_before_send hook (#5347) - Fix missing localization of HTML editor when assets_dir != INSTALL_PATH +- Fix handling of blockquote tags with mixed case on html2text conversion (#5363) RELEASE 1.2.0 ------------- diff --git a/program/lib/Roundcube/rcube_html2text.php b/program/lib/Roundcube/rcube_html2text.php index 269d350ef..82d50a06e 100644 --- a/program/lib/Roundcube/rcube_html2text.php +++ b/program/lib/Roundcube/rcube_html2text.php @@ -587,11 +587,11 @@ class rcube_html2text { $level = 0; $offset = 0; - while (($start = strpos($text, '', $offset); - $next = strpos($text, '', $offset); + $next = stripos($text, ', skip if ($next !== false && $next < $end) { diff --git a/tests/Framework/Html2text.php b/tests/Framework/Html2text.php index be1488295..889ba8241 100644 --- a/tests/Framework/Html2text.php +++ b/tests/Framework/Html2text.php @@ -79,7 +79,7 @@ class rc_html2text extends PHPUnit_Framework_TestCase { $html = <<Begin
OUTER BEGIN
INNER 1

Par 1
-
INNER 2

Par 2
+
INNER 2

Par 2

Par 3

INNER 3
OUTER END
EOF;