From 9320e167f29e49966a9ba6dae28d53e8770a6bae Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Tue, 8 Aug 2006 17:36:55 +0000 Subject: [PATCH] Adjust zend_get_unified_string_type() to give correct types. --- Zend/zend_API.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 31ea41ae9e..e25ace652a 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3816,15 +3816,11 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in * Return the string type that all the passed in types should be converted to. * If none of the types are string types, IS_UNICODE or IS_STRING is returned, * depending on the Unicode semantics switch. - * Binary and Unicode types cannot be mixed, so we return -1 (or 255 since it's - * uchar) */ ZEND_API zend_uchar zend_get_unified_string_type(int num_args TSRMLS_DC, ...) { va_list ap; int best_type = UG(unicode) ? IS_UNICODE : IS_STRING; - zend_bool seen_unicode = 0; - zend_bool seen_string = 0; int type; if (num_args <= 0) return (zend_uchar)-1; @@ -3835,22 +3831,16 @@ ZEND_API zend_uchar zend_get_unified_string_type(int num_args TSRMLS_DC, ...) va_start(ap, num_args); #endif while (num_args--) { - type = va_arg(ap, int); + type = va_arg(ap, int); if (type == IS_UNICODE) { - seen_unicode = 1; best_type = IS_UNICODE; + break; } else if (type == IS_STRING) { - seen_string = 1; best_type = IS_STRING; } } va_end(ap); - /* We do not allow mixing binary and Unicode types */ - if (seen_string && seen_unicode) { - return (zend_uchar)-1; - } - return best_type; } -- 2.50.1