From 5f7b934f8b80af499f459dbcb6fae76eab9a136d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Jan 2019 12:29:14 +0100 Subject: [PATCH] Use serialize_deny handler in PDORow Instead of a custom handler denying serialization, use the standard one. --- ext/pdo/pdo_stmt.c | 9 +-------- 1 file changed, 1 insertion(+), 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)); -- 2.50.1