Skip to content

Commit

Permalink
Fix handling of some improper constructs in format=flowed text as per…
Browse files Browse the repository at this point in the history
… the RFC3676[4.5] (#1490284)

Conflicts:
	CHANGELOG
  • Loading branch information
alecpl committed Feb 19, 2015
1 parent f6336f7 commit ac93924
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CHANGELOG Roundcube Webmail

- Make SMTP error log more verbose - include server response and error code
- Fix security issue in DBMail driver of password plugin (#1490261)
- Fix handling of some improper constructs in format=flowed text as per the RFC3676[4.5] (#1490284)

RELEASE 1.0.5
-------------
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ public static function unfold_flowed($text)
// remove space-stuffing
$line = preg_replace('/^\s/', '', $line);

if (isset($text[$last]) && $line
if (isset($text[$last]) && $line && !$q_level
&& $text[$last] != '-- '
&& $text[$last][strlen($text[$last])-1] == ' '
) {
Expand Down
15 changes: 15 additions & 0 deletions tests/Framework/Mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,21 @@ function test_unfold_flowed()
$this->assertEquals($unfolded, rcube_mime::unfold_flowed($flowed), "Test correct unfolding of quoted lines");
}

/**
* Test format=flowed unfolding (#1490284)
*/
function test_unfold_flowed2()
{
$flowed = "> culpa qui officia deserunt mollit anim id est laborum.\r\n"
."> \r\n"
."Sed ut perspiciatis unde omnis iste natus error \r\nsit voluptatem";
$unfolded = "> culpa qui officia deserunt mollit anim id est laborum.\r\n"
."> \r\n"
."Sed ut perspiciatis unde omnis iste natus error sit voluptatem";

$this->assertEquals($unfolded, rcube_mime::unfold_flowed($flowed), "Test correct unfolding of quoted lines [2]");
}

/**
* Test wordwrap()
*/
Expand Down

0 comments on commit ac93924

Please sign in to comment.