]> granicus.if.org Git - php/commitdiff
Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 31 Aug 2009 12:28:46 +0000 (12:28 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 31 Aug 2009 12:28:46 +0000 (12:28 +0000)
NEWS
ext/standard/string.c

diff --git a/NEWS b/NEWS
index 217285beb51ce71f7cf9247e08190aa30b77b0ef..f79275d629f2616d337879da20389ff355d747b7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PHP                                                                        NEWS
 
 - Fixed leak on error in popen/exec (and related functions on Windows. (Pierre)
 
+- Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries). 
+  (Ilia, code-it at mail dot ru)
 - Fixed bug #49289 (bcmath module doesn't compile with phpize configure).
   (Jani)
 - Fixed bug #49286 (php://input (php_stream_input_read) is broken). (Jani)
index 5d32958088bece6845b57dc2df0e4f4aec19f654..87c6d942162f545c9cb5a7530fff601f7088b7bc 100644 (file)
@@ -836,7 +836,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];