From: Antony Dovgal Date: Fri, 28 Jul 2006 12:23:18 +0000 (+0000) Subject: MFH: patch for #37846 (wordwrap() wraps incorrectly) X-Git-Tag: php-5.2.0RC2~171 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a28a95c11a5d5103df539df4dc5a12cdb9405b03;p=php MFH: patch for #37846 (wordwrap() wraps incorrectly) by Dmitry Kononov --- diff --git a/NEWS b/NEWS index db286a189e..5f9c10d7b7 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,7 @@ PHP NEWS names). (Ilia) - Fixed bug #38047 ("file" and "line" sometimes not set in backtrace from inside error handler). (Dmitry) +- Fixed bug #37846 (wordwrap() wraps incorrectly). (ddk at krasn dot ru, Tony) - Fixed bug #37564 (AES privacy encryption not possible due to net-snmp 5.2 compatibility issue). (Jani, patch by scott dot moynes+php at gmail dot com) diff --git a/ext/standard/string.c b/ext/standard/string.c index 2eacd3ead0..6ab8e008c0 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -669,7 +669,7 @@ PHP_FUNCTION(wordwrap) lastspace = current; } else if (current - laststart >= linelength && laststart != lastspace) { newtext[lastspace] = breakchar[0]; - laststart = lastspace; + laststart = lastspace + 1; } }