mirror of
https://github.com/php/php-src.git
synced 2025-01-11 05:24:49 +08:00
Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
This commit is contained in:
parent
c3615ef874
commit
820d7d28b7
@ -1034,7 +1034,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];
|
||||
|
Loading…
Reference in New Issue
Block a user