]> granicus.if.org Git - php/commitdiff
Make ReflectionGenerator final
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 21 Jul 2020 09:53:00 +0000 (11:53 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 21 Jul 2020 09:53:00 +0000 (11:53 +0200)
This class is not safe against malicious extension / instantiation.

ext/reflection/php_reflection.c
ext/reflection/php_reflection.stub.php
ext/reflection/php_reflection_arginfo.h

index c751da1281244846ea0b13703e1a944231da8119..15237b35110e8d6f63ed4f1c332a92c2e43e2bee 100644 (file)
@@ -6506,6 +6506,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionGenerator", class_ReflectionGenerator_methods);
        reflection_init_class_handlers(&_reflection_entry);
        reflection_generator_ptr = zend_register_internal_class(&_reflection_entry);
+       reflection_generator_ptr->ce_flags |= ZEND_ACC_FINAL;
 
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", class_ReflectionParameter_methods);
        reflection_init_class_handlers(&_reflection_entry);
index 31c08e92b283b6dbcfd5326e01ce14fd987397f6..b617a644e71894692658b044c6f4a3539b1a79b3 100644 (file)
@@ -123,7 +123,7 @@ class ReflectionFunction extends ReflectionFunctionAbstract
     public function getClosure() {}
 }
 
-class ReflectionGenerator
+final class ReflectionGenerator
 {
     public function __construct(Generator $generator) {}
 
index 1d9f730309013eacb12a63c5be720dd2ee6bad85..38da4b658016f503ea6f14b0166b7e4e45025cb6 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 762e9bab89b8edae0b567c1c3926ffa226abe874 */
+ * Stub hash: 330900e4fdcc9691ef971a270d065f859cee47bd */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)