diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2009-08-31 12:28:46 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2009-08-31 12:28:46 +0000 |
| commit | 6a733878770180913177381b2aa05c39a4d2eac1 (patch) | |
| tree | 5c4257ff63b5fa50dcb8cd94d1fa11da7cc804e1 | |
| parent | fe7e08432e3d64274e50337c7105d458badcacf1 (diff) | |
| download | php-git-6a733878770180913177381b2aa05c39a4d2eac1.tar.gz | |
Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
| -rw-r--r-- | NEWS | 2 | ||||
| -rw-r--r-- | ext/standard/string.c | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -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]; |
