]> granicus.if.org Git - php/commitdiff
fix is_object() on non-php objects
authorStanislav Malyshev <stas@php.net>
Wed, 25 May 2005 10:57:40 +0000 (10:57 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 25 May 2005 10:57:40 +0000 (10:57 +0000)
ext/standard/type.c

index 2687f8c0838bca7c0b0e805c1598b287c2c12963..2cda025a037fc7d7e162959253305a95e1ce9cd1 100644 (file)
@@ -207,6 +207,10 @@ static void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
        if (Z_TYPE_PP(arg) == type) {
                if (type == IS_OBJECT) {
                        zend_class_entry *ce;
+                       if(Z_OBJ_HT_PP(arg)->get_class_entry == NULL) {
+                       /* if there's no get_class_entry it's not a PHP object, so it can't be INCOMPLETE_CLASS */
+                               RETURN_TRUE;
+                       }
                        ce = Z_OBJCE_PP(arg);
                        if (!strcmp(ce->name, INCOMPLETE_CLASS)) {
                                RETURN_FALSE;