From: Stanislav Malyshev Date: Thu, 17 Aug 2000 08:47:42 +0000 (+0000) Subject: Fix chunk_split (#6208) X-Git-Tag: php-4.0.2RC1~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56ecc789838e144798f7ff484f210e13c610addd;p=php Fix chunk_split (#6208) --- 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);