svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/standard/string.c branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/string.c
trunk/ext/standard/string.c
| From: | Ilia Alshanetsky | Date: | Mon, 31 Aug 2009 12:28:46 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/standard/string.c branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/string.c trunk/ext/standard/string.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-60273@lists.php.net to get a copy of this message | ||
iliaa Mon, 31 Aug 2009 12:28:46 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=287916
Log:
Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
Bug: http://bugs.php.net/49361 (Verified) wordwrap works
incorrectly
Changed paths:
U php/php-src/branches/PHP_5_2/NEWS
U php/php-src/branches/PHP_5_2/ext/standard/string.c
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/ext/standard/string.c
U php/php-src/trunk/ext/standard/string.c
Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS 2009-08-31 12:07:27 UTC (rev 287915)
+++ php/php-src/branches/PHP_5_2/NEWS 2009-08-31 12:28:46 UTC (rev 287916)
@@ -5,6 +5,8 @@
- 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)
Modified: php/php-src/branches/PHP_5_2/ext/standard/string.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/string.c 2009-08-31 12:07:27 UTC (rev 287915)
+++ php/php-src/branches/PHP_5_2/ext/standard/string.c 2009-08-31 12:28:46 UTC (rev 287916)
@@ -836,7 +836,7 @@
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];
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2009-08-31 12:07:27 UTC (rev 287915)
+++ php/php-src/branches/PHP_5_3/NEWS 2009-08-31 12:28:46 UTC (rev 287916)
@@ -30,6 +30,8 @@
- 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)
Modified: php/php-src/branches/PHP_5_3/ext/standard/string.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/string.c 2009-08-31 12:07:27 UTC (rev 287915)
+++ php/php-src/branches/PHP_5_3/ext/standard/string.c 2009-08-31 12:28:46 UTC (rev 287916)
@@ -825,7 +825,7 @@
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];
Modified: php/php-src/trunk/ext/standard/string.c
===================================================================
--- php/php-src/trunk/ext/standard/string.c 2009-08-31 12:07:27 UTC (rev 287915)
+++ php/php-src/trunk/ext/standard/string.c 2009-08-31 12:28:46 UTC (rev 287916)
@@ -1034,7 +1034,7 @@
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];