Two possible minor bugs in rcube_mime::wordwrap() #4356

Closed
rcubetrac opened this Issue Oct 11, 2013 · 4 comments

Comments

Projects
None yet
2 participants

Reported by encomiast on 11 Oct 2013 22:16 UTC as Trac ticket #1489371

Hi there,

As far as I can tell, there may be two glitches in rcube_mime::wordwrap().

1st:
A message consisting of only one very long line (i.e. with no linebreaks) will not be wrapped at all if there are no blank spaces before the $width limit, but only behind it.
E.g.:

this-is-just-some-blabla-to-make-this-more-than-seventy-five-characters-in-a-row -- this message has no line breaks and will not be wrapped.

[[BR]]
2nd: https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_mime.php#L640
The result from mb_substr() is compared to false, but contrary to substr(), mb_substr() never returns false.
Because of this, a trailing whitespace or linebreak at the end of the last line might get dropped inadvertently.

Cheers,
Florian

Migrated-From: http://trac.roundcube.net/ticket/1489371

Owner changed by @alecpl on 12 Oct 2013 10:33 UTC

=> alec

Milestone changed by @alecpl on 12 Oct 2013 10:33 UTC

later => 0.9.5

Comment by @alecpl on 12 Oct 2013 11:05 UTC

Fixed in 0f15219.

Status changed by @alecpl on 12 Oct 2013 11:05 UTC

new => closed

rcubetrac closed this Oct 12, 2013

alecpl was assigned by rcubetrac Mar 20, 2016

rcubetrac added this to the 0.9.5 milestone Mar 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment