]> granicus.if.org Git - php/commitdiff
Allow mixing Unicode/binary string types.
authorAndrei Zmievski <andrei@php.net>
Fri, 10 Nov 2006 12:01:50 +0000 (12:01 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 10 Nov 2006 12:01:50 +0000 (12:01 +0000)
ext/standard/string.c

index 126ec0d561cf89ac23405f7314c1e17b114a9c78..8ff110e274e6922ef9cd1a173c472206085e3564 100644 (file)
@@ -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);
                                }