com php-src: Make ReflectionGenerator final: ext/reflection/php _reflection.c ext/reflection/php_reflection.stub.ph p
ext/reflection/php_reflection_arginfo.h
| From: | Nikita Popov | Date: | Tue, 21 Jul 2020 09:53:00 +0000 |
| Subject: | com php-src: Make ReflectionGenerator final: ext/reflection/php _reflection.c ext/reflection/php_reflection.stub.ph p ext/reflection/php_reflection_arginfo.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112281@lists.php.net to get a copy of this message | ||
Commit: b3ea6ce720b3811e0c98ba4bdcf9107553d8967a
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 21 Jul 2020 11:53:00 +0200
Parents: 3a9036ac54c016a39a101057f29da30cc0c4c475
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b3ea6ce720b3811e0c98ba4bdcf9107553d8967a
Log:
Make ReflectionGenerator final
This class is not safe against malicious extension / instantiation.
Changed paths:
M ext/reflection/php_reflection.c
M ext/reflection/php_reflection.stub.php
M ext/reflection/php_reflection_arginfo.h
Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index c751da1281..15237b3511 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -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);
diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php
index 31c08e92b2..b617a644e7 100644
--- a/ext/reflection/php_reflection.stub.php
+++ b/ext/reflection/php_reflection.stub.php
@@ -123,7 +123,7 @@ class ReflectionFunction extends ReflectionFunctionAbstract
public function getClosure() {}
}
-class ReflectionGenerator
+final class ReflectionGenerator
{
public function __construct(Generator $generator) {}
diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h
index 1d9f730309..38da4b6580 100644
--- a/ext/reflection/php_reflection_arginfo.h
+++ b/ext/reflection/php_reflection_arginfo.h
@@ -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)