php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60331
Patch php54.patch revision 2011-11-18 17:05 UTC by fedora at famillecollet dot com

Patch php54.patch for mailparse Bug #60331

Patch version 2011-11-18 17:05 UTC

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

Developer: fedora@famillecollet.com

diff -up mailparse-2.1.5/mailparse.c.php54 mailparse-2.1.5/mailparse.c
--- mailparse-2.1.5/mailparse.c.php54	2009-03-03 23:24:04.000000000 +0100
+++ mailparse-2.1.5/mailparse.c	2011-11-18 17:57:46.036409192 +0100
@@ -56,7 +56,7 @@ static size_t mailparse_do_uudecode(php_
 static int le_mime_part;
 
 
-static function_entry mimemessage_methods[] = {
+static zend_function_entry mimemessage_methods[] = {
 	PHP_NAMED_FE(mimemessage,			PHP_FN(mailparse_mimemessage),					NULL)
 	PHP_NAMED_FE(get_child,				PHP_FN(mailparse_mimemessage_get_child),		NULL)
 	PHP_NAMED_FE(get_child_count,		PHP_FN(mailparse_mimemessage_get_child_count),	NULL)
@@ -72,7 +72,7 @@ static function_entry mimemessage_method
 
 static zend_class_entry *mimemsg_class_entry;
 
-function_entry mailparse_functions[] = {
+zend_function_entry mailparse_functions[] = {
 	PHP_FE(mailparse_msg_parse_file,			NULL)
 	PHP_FE(mailparse_msg_get_part,				NULL)
 	PHP_FE(mailparse_msg_get_structure,			NULL)
@@ -240,7 +240,7 @@ PHP_FUNCTION(mailparse_mimemessage)
 		RETURN_FALSE;
 
 	/* prepare the mime part for this object */
-	part = php_mimepart_alloc();
+	part = php_mimepart_alloc(TSRMLS_C);
 	MAKE_STD_ZVAL(zpart);
 	php_mimepart_to_zval(zpart, part);
 
@@ -1074,7 +1074,7 @@ PHP_FUNCTION(mailparse_msg_parse_file)
 
 	filebuf = emalloc(MAILPARSE_BUFSIZ);
 
-	part = php_mimepart_alloc();
+	part = php_mimepart_alloc(TSRMLS_C);
 	php_mimepart_to_zval(return_value, part);
 
 	while(!php_stream_eof(stream))	{
@@ -1113,7 +1113,7 @@ PHP_FUNCTION(mailparse_msg_free)
    Returns a handle that can be used to parse a message */
 PHP_FUNCTION(mailparse_msg_create)
 {
-	php_mimepart *part = php_mimepart_alloc();
+	php_mimepart *part = php_mimepart_alloc(TSRMLS_C);
 
 	php_mimepart_to_zval(return_value, part);
 }
diff -up mailparse-2.1.5/php_mailparse_mime.c.php54 mailparse-2.1.5/php_mailparse_mime.c
--- mailparse-2.1.5/php_mailparse_mime.c.php54	2011-11-18 17:55:38.630980580 +0100
+++ mailparse-2.1.5/php_mailparse_mime.c	2011-11-18 17:59:03.735671654 +0100
@@ -305,7 +305,7 @@ static void php_mimepart_free_child(php_
 	php_mimepart_free(*part TSRMLS_CC);
 }
 
-PHP_MAILPARSE_API php_mimepart *php_mimepart_alloc(void)
+PHP_MAILPARSE_API php_mimepart *php_mimepart_alloc(TSRMLS_D)
 {
 	php_mimepart *part = ecalloc(1, sizeof(php_mimepart));
 
@@ -508,9 +508,9 @@ static int php_mimepart_process_header(p
 	return SUCCESS;
 }
 
-static php_mimepart *alloc_new_child_part(php_mimepart *parentpart, size_t startpos, int inherit)
+static php_mimepart *alloc_new_child_part(php_mimepart *parentpart, size_t startpos, int inherit TSRMLS_DC)
 {
-	php_mimepart *child = php_mimepart_alloc();
+	php_mimepart *child = php_mimepart_alloc(TSRMLS_C);
 	int ret;
 
 	parentpart->parsedata.lastpart = child;
@@ -599,7 +599,7 @@ static int php_mimepart_process_line(php
 				return SUCCESS;
 			}
 
-			newpart = alloc_new_child_part(workpart, workpart->endpos + origcount, 1);
+			newpart = alloc_new_child_part(workpart, workpart->endpos + origcount, 1 TSRMLS_CC);
 			php_mimepart_update_positions(workpart, workpart->endpos + origcount, workpart->endpos + linelen, 1);
 			newpart->mime_version = estrdup(workpart->mime_version);
 			newpart->parsedata.in_header = 1;
@@ -688,7 +688,7 @@ static int php_mimepart_process_line(php
 			}
 					
 			if (CONTENT_TYPE_IS(workpart, "message/rfc822")) {
-				workpart = alloc_new_child_part(workpart, workpart->bodystart, 0);
+				workpart = alloc_new_child_part(workpart, workpart->bodystart, 0 TSRMLS_CC);
 				workpart->parsedata.in_header = 1;
 				return SUCCESS;
 				
@@ -696,7 +696,7 @@ static int php_mimepart_process_line(php
 		
 			/* create a section for the preamble that precedes the first boundary */
 			if (workpart->boundary) {
-				workpart = alloc_new_child_part(workpart, workpart->bodystart, 1);
+				workpart = alloc_new_child_part(workpart, workpart->bodystart, 1 TSRMLS_CC);
 				workpart->parsedata.in_header = 0;
 				workpart->parsedata.is_dummy = 1;
 				return SUCCESS;
diff -up mailparse-2.1.5/php_mailparse_mime.h.php54 mailparse-2.1.5/php_mailparse_mime.h
--- mailparse-2.1.5/php_mailparse_mime.h.php54	2011-11-18 17:55:45.702004867 +0100
+++ mailparse-2.1.5/php_mailparse_mime.h	2011-11-18 17:56:51.954226501 +0100
@@ -81,7 +81,7 @@ struct _php_mimepart {
 
 };
 
-PHP_MAILPARSE_API php_mimepart *php_mimepart_alloc(void);
+PHP_MAILPARSE_API php_mimepart *php_mimepart_alloc(TSRMLS_D);
 PHP_MAILPARSE_API void php_mimepart_free(php_mimepart *part TSRMLS_DC);
 PHP_MAILPARSE_API int php_mimepart_parse(php_mimepart *part, const char *buf, size_t bufsize TSRMLS_DC);
 PHP_MAILPARSE_API void php_mimepart_get_offsets(php_mimepart *part, off_t *start, off_t *end, off_t *start_body, int *nlines, int *nbodylines);
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 02:01:27 2019 UTC