]> granicus.if.org Git - php/commitdiff
Add missing check
authorMarcus Boerger <helly@php.net>
Sun, 24 Aug 2003 22:45:59 +0000 (22:45 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 24 Aug 2003 22:45:59 +0000 (22:45 +0000)
Zend/zend_API.c

index 2c111e4e509ef72ca14469b3fc6fa131ae668f29..ccfb51fce563760ae0db593b56cb2adbd79479d7 100644 (file)
@@ -1629,15 +1629,17 @@ ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_le
        } else {
                target_symbol_table = &ce->default_properties;
        }
-       switch(Z_TYPE_P(property)) {
-               case IS_ARRAY:
-               case IS_CONSTANT_ARRAY:
-               case IS_OBJECT:
-               case IS_RESOURCE:
-                       zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
-                       break;
-               default:
-                       break;
+       if (ce->type & ZEND_INTERNAL_CLASS) {
+               switch(Z_TYPE_P(property)) {
+                       case IS_ARRAY:
+                       case IS_CONSTANT_ARRAY:
+                       case IS_OBJECT:
+                       case IS_RESOURCE:
+                               zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
+                               break;
+                       default:
+                               break;
+               }
        }
        switch (access_type & ZEND_ACC_PPP_MASK) {
                case ZEND_ACC_PRIVATE: {