Skip to content

Commit 5f7b934

Browse files
committed
Use serialize_deny handler in PDORow
Instead of a custom handler denying serialization, use the standard one.
1 parent 32de346 commit 5f7b934

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,13 +2643,6 @@ zend_object *pdo_row_new(zend_class_entry *ce)
26432643
return &row->std;
26442644
}
26452645

2646-
static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data)
2647-
{
2648-
php_error_docref(NULL, E_WARNING, "PDORow instances may not be serialized");
2649-
return FAILURE;
2650-
}
2651-
/* }}} */
2652-
26532646
void pdo_stmt_init(void)
26542647
{
26552648
zend_class_entry ce;
@@ -2677,7 +2670,7 @@ void pdo_stmt_init(void)
26772670
pdo_row_ce = zend_register_internal_class(&ce);
26782671
pdo_row_ce->ce_flags |= ZEND_ACC_FINAL; /* when removing this a lot of handlers need to be redone */
26792672
pdo_row_ce->create_object = pdo_row_new;
2680-
pdo_row_ce->serialize = pdo_row_serialize;
2673+
pdo_row_ce->serialize = zend_class_serialize_deny;
26812674
pdo_row_ce->unserialize = zend_class_unserialize_deny;
26822675

26832676
memcpy(&pdo_row_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));

0 commit comments

Comments
 (0)