summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-11-06 17:21:05 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-11-06 17:21:05 +0000
commit07cdfefdee8cf151453c6fb7f59b124aef9ce066 (patch)
treed112516f35c13e07710f309ac24a22b87f8e0de7 /ext/standard/string.c
parent4cb16d8328a0ca1f4f17a06a8f18266e2a97130c (diff)
downloadphp-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.c7
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();
+ }
}
/* }}} */