diff options
author | Stanislav Malyshev <stas@php.net> | 2016-10-03 19:17:42 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2016-10-03 19:17:42 -0700 |
commit | 8ea01d5f19a68a3f062c1e5d735372f8a48cbba8 (patch) | |
tree | f51c59fe7340ae924292a8dd34e94ea3fb2421bf | |
parent | 631173aa5c716f6d4a7bf1f6b7295482a46823bc (diff) | |
download | php-git-8ea01d5f19a68a3f062c1e5d735372f8a48cbba8.tar.gz |
Apparently negative wordwrap is a thing and should work as length = 0.
I'll leave it as is for now.
-rw-r--r-- | ext/standard/string.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index cb6a8b4315..abe4eb1aba 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -908,7 +908,11 @@ PHP_FUNCTION(wordwrap) RETURN_FALSE; } - if (linelength < 0 || linelength > INT_MAX) { + if (linelength < 0) { + /* For BC */ + linelength = 0; + } + if (linelength > INT_MAX) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length should be between 0 and %d", INT_MAX); RETURN_FALSE; } |