]> granicus.if.org Git - php/commitdiff
Unicode mode doesn't allow non-unicode properties
authorDmitry Stogov <dmitry@php.net>
Wed, 17 Aug 2005 17:07:52 +0000 (17:07 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 17 Aug 2005 17:07:52 +0000 (17:07 +0000)
Zend/zend_builtin_functions.c
Zend/zend_object_handlers.c

index 1fea4f6c2031d35f8232dbb8cea374fdaf8bb3cc..1bab7ac4fe0dbb225043a748992d5c16f717c67b 100644 (file)
@@ -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);
        }
 
index 177048e6b41454ce58fe43ebab4703705e691610..03a0fcd849a5f82eda77740d37fc572f0521f958 100644 (file)
@@ -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);