summaryrefslogtreecommitdiffstats
path: root/fa3c4f0c327aee0f12d071b13458de70164d8fe0.patch
blob: 555228963b3474de4c3ea835e1d0c7a16b02e5ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From fa3c4f0c327aee0f12d071b13458de70164d8fe0 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Wed, 2 Sep 2020 11:53:27 +0200
Subject: [PATCH] mbfl_convert_filter_feed removed in 8.0.0beta3

---
 mailparse.c          | 4 ++--
 php_mailparse.h      | 7 +++++++
 php_mailparse_mime.c | 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/mailparse.c b/mailparse.c
index 8c706c2..a519c5b 100644
--- a/mailparse.c
+++ b/mailparse.c
@@ -1020,7 +1020,7 @@ PHP_FUNCTION(mailparse_stream_encode)
 				}
 
 				for (; i<len; i++)
-					mbfl_convert_filter_feed(buf[i], conv);
+					MBFL_CONVERT_FILTER_FEED(buf[i], conv);
 			}
 		}
 
@@ -1031,7 +1031,7 @@ PHP_FUNCTION(mailparse_stream_encode)
 			{
 				size_t i;
 				for (i=0; i<len; i++)
-					mbfl_convert_filter_feed(buf[i], conv);
+					MBFL_CONVERT_FILTER_FEED(buf[i], conv);
 			}
 		}
 	}
diff --git a/php_mailparse.h b/php_mailparse.h
index e624b2c..a4b9515 100644
--- a/php_mailparse.h
+++ b/php_mailparse.h
@@ -95,6 +95,13 @@ extern ZEND_DECLARE_MODULE_GLOBALS(mailparse);
 #define MAILPARSEG(v) (mailparse_globals.v)
 #endif
 
+#if PHP_VERSION_ID < 80000
+#define MBFL_CONVERT_FILTER_FEED(c, filter) mbfl_convert_filter_feed((c), (filter))
+#else
+/* helper removed from 8.0.0beta3 */
+#define MBFL_CONVERT_FILTER_FEED(c, filter) (*(filter)->filter_function)((c), (filter))
+#endif
+
 #endif
 
 
diff --git a/php_mailparse_mime.c b/php_mailparse_mime.c
index b4dbd65..27e5a9c 100644
--- a/php_mailparse_mime.c
+++ b/php_mailparse_mime.c
@@ -967,7 +967,7 @@ PHP_MAILPARSE_API int php_mimepart_decoder_feed(php_mimepart *part, const char *
 
 		if (part->extract_filter) {
 			for (i = 0; i < bufsize; i++) {
-				if (mbfl_convert_filter_feed(buf[i], part->extract_filter) < 0) {
+				if (MBFL_CONVERT_FILTER_FEED(buf[i], part->extract_filter) < 0) {
 					zend_error(E_WARNING, "%s() - filter conversion failed. Input message is probably incorrectly encoded\n",
 							get_active_function_name());
 					return -1;