summaryrefslogtreecommitdiff
path: root/Zend/zend_constants.c
diff options
context:
space:
mode:
authorDanielCiochiu <daniel@ciochiu.ro>2019-02-12 11:40:46 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-02-12 11:42:33 +0100
commit07877c46e3057bc679766898d50529be812243f3 (patch)
treea1b80fb59cdec063ea890351ff01636acdb88454 /Zend/zend_constants.c
parent8e34de475699a4aa0fbc7b8430574b56dc839362 (diff)
downloadphp-git-07877c46e3057bc679766898d50529be812243f3.tar.gz
Fixed bug #75546
By respecting the SILENT flag when checking the visibility of a class constant.
Diffstat (limited to 'Zend/zend_constants.c')
-rw-r--r--Zend/zend_constants.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 14d712235a..64265d3c19 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -341,7 +341,9 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
ret_constant = NULL;
} else {
if (!zend_verify_const_access(c, scope)) {
- zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
+ if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
+ zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
+ }
goto failure;
}
ret_constant = &c->value;