From: Ilia Alshanetsky Date: Mon, 31 Aug 2009 12:28:46 +0000 (+0000) Subject: Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries). X-Git-Tag: php-5.4.0alpha1~191^2~2721 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=820d7d28b7bb9b26987f120fe42c5fe20140cc82;p=php Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries). --- diff --git a/ext/standard/string.c b/ext/standard/string.c index f28c284f3c..50a54defb9 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1034,7 +1034,7 @@ PHP_FUNCTION(wordwrap) laststart = lastspace = 0; for (current = 0; current < textlen; current++) { if (text[current] == breakchar[0]) { - laststart = lastspace = current; + laststart = lastspace = current + 1; } else if (text[current] == ' ') { if (current - laststart >= linelength) { newtext[current] = breakchar[0];