From 8c33fcf7ce406291f451aff9774cf11d676dfd23 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 17 Aug 2005 17:07:52 +0000 Subject: [PATCH] Unicode mode doesn't allow non-unicode properties --- Zend/zend_builtin_functions.c | 4 ++-- Zend/zend_object_handlers.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 1fea4f6c20..1bab7ac4fe 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -929,7 +929,7 @@ ZEND_FUNCTION(method_exists) RETURN_FALSE; } - if (Z_TYPE_PP(method_name) != IS_STRING || Z_TYPE_PP(method_name) == IS_UNICODE) { + if (Z_TYPE_PP(method_name) != (UG(unicode)?IS_UNICODE:IS_STRING)) { convert_to_text_ex(method_name); } lcname = zend_u_str_case_fold(Z_TYPE_PP(method_name), Z_UNIVAL_PP(method_name), Z_UNILEN_PP(method_name), 1, &lcname_len); @@ -971,7 +971,7 @@ ZEND_FUNCTION(property_exists) ZEND_WRONG_PARAM_COUNT(); } - if (Z_TYPE_PP(property) != IS_STRING && Z_TYPE_PP(property) != IS_UNICODE) { + if (Z_TYPE_PP(property) != IS_UNICODE && (UG(unicode) || (Z_TYPE_PP(property) != IS_STRING))) { convert_to_text_ex(property); } diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 177048e6b4..03a0fcd849 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -291,7 +291,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) zobj = Z_OBJ_P(object); use_get = (zobj->ce->__get && !zobj->in_get); - if (member->type != IS_STRING && member->type != IS_UNICODE) { + if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { ALLOC_ZVAL(tmp_member); *tmp_member = *member; INIT_PZVAL(tmp_member); @@ -347,7 +347,7 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM zobj = Z_OBJ_P(object); use_set = (zobj->ce->__set && !zobj->in_set); - if (member->type != IS_STRING && member->type != IS_UNICODE) { + if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { ALLOC_ZVAL(tmp_member); *tmp_member = *member; INIT_PZVAL(tmp_member); @@ -494,7 +494,7 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC zobj = Z_OBJ_P(object); - if (member->type != IS_STRING && member->type != IS_UNICODE) { + if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { tmp_member = *member; zval_copy_ctor(&tmp_member); convert_to_text(&tmp_member); @@ -539,7 +539,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC) zobj = Z_OBJ_P(object); use_unset = (zobj->ce->__unset && !zobj->in_unset); - if (member->type != IS_STRING && member->type != IS_UNICODE) { + if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { ALLOC_ZVAL(tmp_member); *tmp_member = *member; INIT_PZVAL(tmp_member); @@ -919,7 +919,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists zobj = Z_OBJ_P(object); use_isset = (zobj->ce->__isset && !zobj->in_isset); - if (member->type != IS_STRING && member->type != IS_UNICODE) { + if (member->type != IS_UNICODE && (UG(unicode) || member->type != IS_STRING)) { ALLOC_ZVAL(tmp_member); *tmp_member = *member; INIT_PZVAL(tmp_member); -- 2.40.0