Aleksander Machniak
2013-05-23 db108e37793c7f8fc8ba11f00d0561d1f0bd32c0
Fix another text wrapping issue (wrong handling of long unwrappable lines)
3 files modified
10 ■■■■■ changed files
program/lib/Roundcube/rcube_mime.php 4 ●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 2 ●●● patch | view | raw | blame | history
tests/Framework/Mime.php 4 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_mime.php
@@ -658,6 +658,10 @@
                            $subString = $substr_func($subString, 0, $spacePos, $charset);
                            $cutLength = $spacePos + 1;
                        }
                        else if ($cut === false && $breakPos === false) {
                            $subString = $string;
                            $cutLength = null;
                        }
                        else if ($cut === false) {
                            $spacePos = $strpos_func($string, ' ', 0, $charset);
program/steps/mail/func.inc
@@ -1516,7 +1516,7 @@
/**
 * Wrap text to a given number of characters per line
 * but respect the mail quotation of replies messages (>).
 * Finally add another quotation level by prpending the lines
 * Finally add another quotation level by prepending the lines
 * with >
 *
 * @param string Text to wrap
tests/Framework/Mime.php
@@ -193,6 +193,10 @@
                array("-------\nabc def", 5),
                "-------\nabc\ndef",
            ),
            array(
                array("http://xx.xxx.xx.xxx:8080/addressbooks/roundcubexxxxx%40xxxxxxxxxxxxxxxxxxxxxxx.xx.xx/testing/", 70),
                "http://xx.xxx.xx.xxx:8080/addressbooks/roundcubexxxxx%40xxxxxxxxxxxxxxxxxxxxxxx.xx.xx/testing/",
            ),
        );
        foreach ($samples as $sample) {