summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-08-31 12:28:46 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-08-31 12:28:46 +0000
commit6a733878770180913177381b2aa05c39a4d2eac1 (patch)
tree5c4257ff63b5fa50dcb8cd94d1fa11da7cc804e1
parentfe7e08432e3d64274e50337c7105d458badcacf1 (diff)
downloadphp-git-6a733878770180913177381b2aa05c39a4d2eac1.tar.gz
Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
-rw-r--r--NEWS2
-rw-r--r--ext/standard/string.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index cc6f70a974..ae130d06e7 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,8 @@ PHP NEWS
- Fixed BC break in mime_content_type(), removes the content encoding. (Scott)
- Fixed bug #49391 (ldap.c utilizing deprecated ldap_modify_s). (Ilia)
+- Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
+ (Ilia, code-it at mail dot ru)
- Fixed bug #49372 (segfault in php_curl_option_curl). (Pierre)
- Fixed bug #49306 (inside pdo_mysql default socket settings are ignored).
(Ilia)
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 4c3a44b34d..9408e6b019 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -825,7 +825,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];