php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64083
Patch gnupg-php54-fixes revision 2013-01-27 00:31 UTC by iliya at polihronov dot com

Patch gnupg-php54-fixes for gnupg Bug #64083

Patch version 2013-01-27 00:31 UTC

Return to Bug #64083 | Download this patch
Patch Revisions:

Developer: iliya@polihronov.com

diff -Naur gnupg-1.3.2/gnupg.c gnupg-1.3.2.patched/gnupg.c
--- gnupg-1.3.2/gnupg.c	1970-01-01 03:13:08.000000000 -0600
+++ gnupg-1.3.2.patched/gnupg.c	2012-09-07 11:31:03.496000000 -0500
@@ -158,6 +158,10 @@
 		return;
 	}
 	gnupg_free_resource_ptr(intern TSRMLS_CC);
+
+#if ZEND_MODULE_API_NO >= 20100525
+	intern->zo.properties_table = NULL;
+#endif
 	if(intern->zo.properties){
 		zend_hash_destroy(intern->zo.properties);
 		FREE_HASHTABLE(intern->zo.properties);
@@ -175,12 +179,17 @@
 	
 	intern					=	emalloc(sizeof(gnupg_object));
 	intern->zo.ce			=	class_type;
-	intern->zo.properties	=	NULL;
 	
-	ALLOC_HASHTABLE	(intern->zo.properties);
-	zend_hash_init	(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-	zend_hash_copy	(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 	
+	//object_properties_init
+	
+	
+	zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+#if ZEND_MODULE_API_NO >= 20100525
+	object_properties_init(&intern->zo, class_type);
+#else
+	zend_hash_copy  (intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
+#endif	
 	retval.handle		=	zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_obj_dtor,NULL TSRMLS_CC);
 	retval.handlers		=	(zend_object_handlers *) & gnupg_object_handlers;
 	gnupg_res_init	(intern TSRMLS_CC);
diff -Naur gnupg-1.3.2/gnupg_keylistiterator.c gnupg-1.3.2.patched/gnupg_keylistiterator.c
--- gnupg-1.3.2/gnupg_keylistiterator.c	1970-01-01 03:13:08.000000000 -0600
+++ gnupg-1.3.2.patched/gnupg_keylistiterator.c	2012-09-07 11:33:14.440000000 -0500
@@ -54,6 +54,9 @@
 /*
 	zval_dtor(&intern->pattern);
 */	
+#if ZEND_MODULE_API_NO >= 20100525
+	intern->zo.properties_table = NULL;
+#endif
 	if(intern->zo.properties){
 		zend_hash_destroy(intern->zo.properties);
 		FREE_HASHTABLE(intern->zo.properties);
@@ -70,7 +73,8 @@
 
 	intern =	emalloc(sizeof(gnupg_keylistiterator_object));
 	intern->zo.ce = class_type;
-	intern->zo.properties = NULL;
+	
+	zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
 	retval.handle   =   zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_keylistiterator_dtor,NULL TSRMLS_CC);
 	retval.handlers	=	(zend_object_handlers *) & gnupg_keylistiterator_object_handlers;
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Dec 04 12:01:23 2020 UTC