Skip to content

Commit

Permalink
Only use zend_class_serialize_deny and zend_class_unserialize_deny in…
Browse files Browse the repository at this point in the history
… PHP versions before 8.1 (#101)

Refs: #100
  • Loading branch information
WyriHaximus committed Aug 19, 2021
1 parent 67f261f commit 35728fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions php_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2679,9 +2679,14 @@ static zend_class_entry *php_uv_register_internal_class_ex(const char *name, zen
ce.name = zend_new_interned_string(zend_string_init(name, strlen(name), 1));
ce.info.internal.builtin_functions = php_uv_empty_methods;
new = zend_register_internal_class_ex(&ce, parent);
#if PHP_VERSION_ID < 80100
new->serialize = zend_class_serialize_deny;
new->unserialize = zend_class_unserialize_deny;
#endif
new->ce_flags |= ZEND_ACC_FINAL;
#if PHP_VERSION_ID >= 80100
new->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE ;
#endif
new->create_object = php_uv_create_uv;

return new;
Expand Down

0 comments on commit 35728fb

Please sign in to comment.