From 2d40fd328d9899dffd38956e2a3ab53de282260f Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 10 Nov 2006 12:01:50 +0000 Subject: [PATCH] Allow mixing Unicode/binary string types. --- ext/standard/string.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 126ec0d561..8ff110e274 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1179,26 +1179,12 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *retval TSRMLS_DC) while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **)&tmp, &pos) == SUCCESS) { if (Z_TYPE_PP(tmp) != return_type) { if (return_type == IS_UNICODE) { - if (Z_TYPE_PP(tmp) == IS_STRING) { - /* ERROR */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot mix binary strings with other string types"); - efree(Z_USTRVAL_P(retval)); - ZVAL_FALSE(retval); - return; - } else { + if (Z_TYPE_PP(tmp) != IS_UNICODE) { SEPARATE_ZVAL(tmp); convert_to_unicode_ex(tmp); } } else if (return_type == IS_STRING) { - if (Z_TYPE_PP(tmp) == IS_UNICODE) { - /* ERROR */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot mix binary strings with other string types"); - efree(Z_STRVAL_P(retval)); - ZVAL_FALSE(retval); - return; - } else { + if (Z_TYPE_PP(tmp) != IS_STRING) { SEPARATE_ZVAL(tmp); convert_to_string_ex(tmp); } -- 2.50.1