]> granicus.if.org Git - php/commitdiff
Don't allow properties on former resource objects
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 08:35:03 +0000 (10:35 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 08:37:16 +0000 (10:37 +0200)
ext/gd/gd.c
ext/pspell/pspell.c

index 26eff9730ce8818ef3ee865217e4e9eecf6fc7d8..efc296d18fe65538416031fa9034bf7e531db3fb 100644 (file)
@@ -281,7 +281,7 @@ static void php_gd_font_object_free(zend_object *zobj)
 
 static zend_function *php_gd_font_object_get_constructor(zend_object *object)
 {
-       zend_throw_error(NULL, "You cannot initialize a GdImage object except through helper functions");
+       zend_throw_error(NULL, "You cannot initialize a GdFont object except through helper functions");
        return NULL;
 }
 
@@ -290,7 +290,7 @@ static void php_gd_font_minit_helper()
        zend_class_entry ce;
        INIT_CLASS_ENTRY(ce, "GdFont", class_GdFont_methods);
        gd_font_ce = zend_register_internal_class(&ce);
-       gd_font_ce->ce_flags |= ZEND_ACC_FINAL;
+       gd_font_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
        gd_font_ce->create_object = php_gd_font_object_create;
        gd_font_ce->serialize = zend_class_serialize_deny;
        gd_font_ce->unserialize = zend_class_unserialize_deny;
index 34859076a2526d33a03bdef869fa68c63a23b575..4253f5f1595f83f715c4d0ffa06d2d505fadade4 100644 (file)
@@ -153,7 +153,7 @@ static PHP_MINIT_FUNCTION(pspell)
        zend_class_entry ce;
        INIT_CLASS_ENTRY(ce, "PSpell", class_PSpell_methods);
        php_pspell_ce = zend_register_internal_class(&ce);
-       php_pspell_ce->ce_flags |= ZEND_ACC_FINAL;
+       php_pspell_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
        php_pspell_ce->create_object = php_pspell_object_create;
        php_pspell_ce->serialize = zend_class_serialize_deny;
        php_pspell_ce->unserialize = zend_class_unserialize_deny;
@@ -166,7 +166,7 @@ static PHP_MINIT_FUNCTION(pspell)
 
        INIT_CLASS_ENTRY(ce, "PSpellConfig", class_PSpellConfig_methods);
        php_pspell_config_ce = zend_register_internal_class(&ce);
-       php_pspell_config_ce->ce_flags |= ZEND_ACC_FINAL;
+       php_pspell_config_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
        php_pspell_config_ce->create_object = php_pspell_config_object_create;
        php_pspell_config_ce->serialize = zend_class_serialize_deny;
        php_pspell_config_ce->unserialize = zend_class_unserialize_deny;