diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-11-06 17:21:05 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-11-06 17:21:05 +0000 |
| commit | 07cdfefdee8cf151453c6fb7f59b124aef9ce066 (patch) | |
| tree | d112516f35c13e07710f309ac24a22b87f8e0de7 /ext/standard/string.c | |
| parent | 4cb16d8328a0ca1f4f17a06a8f18266e2a97130c (diff) | |
| download | php-git-07cdfefdee8cf151453c6fb7f59b124aef9ce066.tar.gz | |
Fixed bug #39350 (crash with implode("\n", array(false))).
Diffstat (limited to 'ext/standard/string.c')
| -rw-r--r-- | ext/standard/string.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 7fe1e5ef4e..adf0077e4a 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -955,7 +955,12 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC) } smart_str_0(&implstr); - RETURN_STRINGL(implstr.c, implstr.len, 0); + if (implstr.len) { + RETURN_STRINGL(implstr.c, implstr.len, 0); + } else { + smart_str_free(&implstr); + RETURN_EMPTY_STRING(); + } } /* }}} */ |
