summaryrefslogtreecommitdiffstats
path: root/yaf-upstream.patch
blob: 0b40a1365d196cb6525a817427743d77e68bdef0 (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
From b1d252c944a8d70f0dc28415b3d67a7b3bbbf7ce Mon Sep 17 00:00:00 2001
From: Xinchen Hui <laruence@gmail.com>
Date: Tue, 25 Jun 2024 11:39:59 +0800
Subject: [PATCH] Fixed build with trunk(8.4)

---
 routes/yaf_route_regex.c   | 9 ++++++++-
 routes/yaf_route_rewrite.c | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/routes/yaf_route_regex.c b/routes/yaf_route_regex.c
index 45410804..9dd0e2fe 100644
--- a/routes/yaf_route_regex.c
+++ b/routes/yaf_route_regex.c
@@ -204,13 +204,20 @@ static int yaf_route_regex_match(yaf_route_regex_object *regex, const char *uri,
 #if PHP_VERSION_ID < 70400
 		php_pcre_match_impl(pce_regexp, (char*)uri, len, &matches, &subparts /* subpats */,
 				0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
-#else
+#elif PHP_VERSION_ID < 80400
 		{
 			zend_string *tmp = zend_string_init(uri, len, 0);
 			php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
 					0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
 			zend_string_release(tmp);
 		}
+#else
+		{
+			zend_string *tmp = zend_string_init(uri, len, 0);
+			php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
+					0/* global */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
+			zend_string_release(tmp);
+		}
 #endif
 
 		if (!zend_hash_num_elements(Z_ARRVAL(subparts))) {
diff --git a/routes/yaf_route_rewrite.c b/routes/yaf_route_rewrite.c
index 716ae6fd..b7b4200a 100644
--- a/routes/yaf_route_rewrite.c
+++ b/routes/yaf_route_rewrite.c
@@ -209,13 +209,20 @@ static int yaf_route_rewrite_match(yaf_route_rewrite_object *rewrite, const char
 #if PHP_VERSION_ID < 70400
 		php_pcre_match_impl(pce_regexp, (char*)uri, len, &matches, &subparts /* subpats */,
 				0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
-#else
+#elif PHP_VERSION_ID <80400
 		{
 			zend_string *tmp = zend_string_init(uri, len, 0);
 			php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
 					0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
 			zend_string_release(tmp);
 		}
+#else
+		{
+			zend_string *tmp = zend_string_init(uri, len, 0);
+			php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
+					0/* global */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
+			zend_string_release(tmp);
+		}
 #endif
 
 		if (!zend_hash_num_elements(Z_ARRVAL(subparts))) {