summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-01-10 12:29:14 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-01-10 12:37:26 +0100
commit5f7b934f8b80af499f459dbcb6fae76eab9a136d (patch)
tree278f0178d61ffb6465bdb98052050edd51cb8193
parent32de3469d9eeebfaec8706865f10401656d60dba (diff)
downloadphp-git-5f7b934f8b80af499f459dbcb6fae76eab9a136d.tar.gz
Use serialize_deny handler in PDORow
Instead of a custom handler denying serialization, use the standard one.
-rw-r--r--ext/pdo/pdo_stmt.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index e938eaf4b4..55d3f53fbe 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2643,13 +2643,6 @@ zend_object *pdo_row_new(zend_class_entry *ce)
return &row->std;
}
-static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data)
-{
- php_error_docref(NULL, E_WARNING, "PDORow instances may not be serialized");
- return FAILURE;
-}
-/* }}} */
-
void pdo_stmt_init(void)
{
zend_class_entry ce;
@@ -2677,7 +2670,7 @@ void pdo_stmt_init(void)
pdo_row_ce = zend_register_internal_class(&ce);
pdo_row_ce->ce_flags |= ZEND_ACC_FINAL; /* when removing this a lot of handlers need to be redone */
pdo_row_ce->create_object = pdo_row_new;
- pdo_row_ce->serialize = pdo_row_serialize;
+ pdo_row_ce->serialize = zend_class_serialize_deny;
pdo_row_ce->unserialize = zend_class_unserialize_deny;
memcpy(&pdo_row_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));