diff options
author | Stanislav Malyshev <stas@php.net> | 2000-08-17 08:47:42 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2000-08-17 08:47:42 +0000 |
commit | 56ecc789838e144798f7ff484f210e13c610addd (patch) | |
tree | d7524972898e7936683443a3fd2ed2ca5bafb572 | |
parent | 056401fa6c4c1b0a82e75acc6ea1ebfef2a06cab (diff) | |
download | php-git-56ecc789838e144798f7ff484f210e13c610addd.tar.gz |
Fix chunk_split (#6208)
-rw-r--r-- | ext/standard/string.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 0d1862710b..2c415cc8f4 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1040,11 +1040,15 @@ PHP_FUNCTION(chunk_split) convert_to_string_ex(p_str); } - if(chunklen == 0) { - php_error(E_WARNING, "chunk length is 0"); + if(chunklen <= 0) { + php_error(E_WARNING, "Chunk length should be greater than zero"); RETURN_FALSE; } - + + if((*p_str)->value.str.len == 0) { + RETURN_EMPTY_STRING(); + } + result = php_chunk_split((*p_str)->value.str.val, (*p_str)->value.str.len, end, endlen, chunklen, &result_len); |