Fix handling of blockquote tags with mixed case on html2text conversion (#5363)

pull/321/merge
Aleksander Machniak 8 years ago
parent 7a7a6795f0
commit d91bad5975

@ -48,6 +48,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
-------------

@ -587,11 +587,11 @@ class rcube_html2text
{
$level = 0;
$offset = 0;
while (($start = strpos($text, '<blockquote', $offset)) !== false) {
while (($start = stripos($text, '<blockquote', $offset)) !== false) {
$offset = $start + 12;
do {
$end = strpos($text, '</blockquote>', $offset);
$next = strpos($text, '<blockquote', $offset);
$end = stripos($text, '</blockquote>', $offset);
$next = stripos($text, '<blockquote', $offset);
// nested <blockquote>, skip
if ($next !== false && $next < $end) {

@ -79,7 +79,7 @@ class rc_html2text extends PHPUnit_Framework_TestCase
{
$html = <<<EOF
<br>Begin<br><blockquote>OUTER BEGIN<blockquote>INNER 1<br></blockquote><div><br></div><div>Par 1</div>
<blockquote>INNER 2</blockquote><div><br></div><div>Par 2</div>
<blockQuote>INNER 2</blockquote><div><br></div><div>Par 2</div>
<div><br></div><div>Par 3</div><div><br></div>
<blockquote>INNER 3</blockquote>OUTER END</blockquote>
EOF;

Loading…
Cancel
Save