aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/ext/google/protobuf/message.c
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2017-07-17 09:36:22 -0700
committerGravatar Bo Yang <teboring@google.com>2017-07-18 11:06:16 -0700
commit6ec0b7e4d1fb606c6572a946e4eae97273367e67 (patch)
treed983812539a3299ff130fff469140bdcd1bb1690 /php/ext/google/protobuf/message.c
parent324b20a49170cb38d15ef243bc044026adb54ae1 (diff)
parent5532abc15b97f3489183b266b41844306052a3fa (diff)
Merge 3.3.x into master
Diffstat (limited to 'php/ext/google/protobuf/message.c')
-rw-r--r--php/ext/google/protobuf/message.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c
index b8ef9fc0..254640c7 100644
--- a/php/ext/google/protobuf/message.c
+++ b/php/ext/google/protobuf/message.c
@@ -115,7 +115,11 @@ static void message_set_property(zval* object, zval* member, zval* value,
return;
}
+#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
if (Z_OBJCE_P(object) != EG(scope)) {
+#else
+ if (Z_OBJCE_P(object) != zend_get_executed_scope()) {
+#endif
// User cannot set property directly (e.g., $m->a = 1)
zend_error(E_USER_ERROR, "Cannot access private property.");
return;
@@ -145,7 +149,11 @@ static zval* message_get_property(zval* object, zval* member, int type,
return PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL;
}
+#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
if (Z_OBJCE_P(object) != EG(scope)) {
+#else
+ if (Z_OBJCE_P(object) != zend_get_executed_scope()) {
+#endif
// User cannot get property directly (e.g., $a = $m->a)
zend_error(E_USER_ERROR, "Cannot access private property.");
return PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL;