diff options
author | Remi Collet <remi@remirepo.net> | 2024-07-10 16:54:56 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-07-10 16:54:56 +0200 |
commit | 153a551ea34a48715937bd8e23cb04c5f367e3de (patch) | |
tree | 2096223b440282e3aed44ba7499f32574c48971d /yaf-upstream.patch | |
parent | 22182cfccd452cf5159a9e125897656bfbc4083c (diff) |
add upstream patch for PHP 8.4
Diffstat (limited to 'yaf-upstream.patch')
-rw-r--r-- | yaf-upstream.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/yaf-upstream.patch b/yaf-upstream.patch new file mode 100644 index 0000000..0b40a13 --- /dev/null +++ b/yaf-upstream.patch @@ -0,0 +1,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))) { |