]> granicus.if.org Git - php/commitdiff
Use serialize_deny handler in PDORow
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 10 Jan 2019 11:29:14 +0000 (12:29 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 10 Jan 2019 11:37:26 +0000 (12:37 +0100)
Instead of a custom handler denying serialization, use the standard
one.

ext/pdo/pdo_stmt.c

index e938eaf4b4afe4943ca6c3a068bc0331362b7866..55d3f53fbeccccdc447af5de69185a543972d4e5 100644 (file)
@@ -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));