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))) {