Skip to content

Commit b3ea6ce

Browse files
committed
Make ReflectionGenerator final
This class is not safe against malicious extension / instantiation.
1 parent 3a9036a commit b3ea6ce

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

ext/reflection/php_reflection.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6506,6 +6506,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
65066506
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionGenerator", class_ReflectionGenerator_methods);
65076507
reflection_init_class_handlers(&_reflection_entry);
65086508
reflection_generator_ptr = zend_register_internal_class(&_reflection_entry);
6509+
reflection_generator_ptr->ce_flags |= ZEND_ACC_FINAL;
65096510

65106511
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", class_ReflectionParameter_methods);
65116512
reflection_init_class_handlers(&_reflection_entry);

ext/reflection/php_reflection.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function invokeArgs(array $args) {}
123123
public function getClosure() {}
124124
}
125125

126-
class ReflectionGenerator
126+
final class ReflectionGenerator
127127
{
128128
public function __construct(Generator $generator) {}
129129

ext/reflection/php_reflection_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 762e9bab89b8edae0b567c1c3926ffa226abe874 */
2+
* Stub hash: 330900e4fdcc9691ef971a270d065f859cee47bd */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)

0 commit comments

Comments
 (0)