]> granicus.if.org Git - php/commitdiff
- Fix bug #55776 (PDORow to session bug)
authorJohannes Schlüter <johannes@php.net>
Sun, 25 Sep 2011 12:39:05 +0000 (12:39 +0000)
committerJohannes Schlüter <johannes@php.net>
Sun, 25 Sep 2011 12:39:05 +0000 (12:39 +0000)
ext/pdo/pdo_stmt.c

index 7a2c3c0630b39f290060e9dff85fa89b53fd3f57..451318268ada4b3366b32e63fe34c9d4aad896b8 100755 (executable)
@@ -2339,6 +2339,7 @@ static zend_object_value dbstmt_clone_obj(zval *zobject TSRMLS_DC)
 }
 
 zend_object_handlers pdo_dbstmt_object_handlers;
+static int pdo_row_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
 
 void pdo_stmt_init(TSRMLS_D)
 {
@@ -2362,6 +2363,7 @@ void pdo_stmt_init(TSRMLS_D)
        pdo_row_ce = zend_register_internal_class(&ce TSRMLS_CC);
        pdo_row_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; /* 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;
 }
 
 static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
@@ -2802,6 +2804,12 @@ zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC)
 
        return retval;
 }
+
+static int pdo_row_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC)
+{
+       php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDORow instances may not be serialized");
+       return FAILURE;
+}
 /* }}} */
 
 /*